title: luabind 'Trying to use unregistered class' on return
body: <p>I'm currently using luabind to bind a class (sf::Time from SFML 2.0 to be exact), and I keep getting an exception from luabind. Here is my binding code:</p>
  
  <pre><code>            using namespace luabind;
  
              module(L, "system")
              [
                  class_&lt;sf::Time&gt;("Time")
                      .def(constructor&lt;&gt;())
                      .def("toSeconds", &amp;sf::Time::asSeconds)
                      .def("toMilliseconds", &amp;sf::Time::asMilliseconds)
                      .def("toMicroseconds", &amp;sf::Time::asMicroseconds)
                      .def(self == other&lt;sf::Time&gt;())
                      .def(self &lt; other&lt;sf::Time&gt;())
                      .def(self &lt;= other&lt;sf::Time&gt;())
                      .def(self - other&lt;sf::Time&gt;())
                      .def(self + other&lt;sf::Time&gt;())
                      .def(self * float())
                      .def(self / float())
                      .scope
                      [
                          def("seconds", &amp;sf::seconds),
                          def("milliseconds", &amp;sf::milliseconds),
                          def("microseconds", &amp;sf::microseconds)
                      ],
  ...
  </code></pre>
  
  <p>My lua code is:</p>
  
  <pre><code>local t = system.Time.seconds(10)
  </code></pre>
  
  <p>The signature of sf::seconds is:</p>
  
  <pre><code>sf::Time sf::seconds(float)
  </code></pre>
  
  <p>I've tried wrapping the call to sf::seconds in my own function that returns sf::Time, and I tried using sf::Time* as the return value as well. No matter what, I keep getting the error.</p>
  
  <p>Any ideas?</p>
  
  <p>EDIT:</p>
  
  <p>I have tested the class its self, and i can create it in Lua using system.Time(), no problem. All the methods work correctly, but system.Time.seconds and the other static methods don't work.</p>