title: Assign value to Chaiscript variable through user-type object gives unexpect behaviour
body: <p>I've got a peculiar problem with C++ and Chaiscript, hope somebody can help me with it, and 
  I'll try to give it as much information as it is needed.</p>
  
  <p>Basically, calling a c++ function defined in c++ through chaiscript, which returns a Vector2 object (user-type object), will return crazy values when I try to get a value directly from a member variable of Vector2 (x or y).
  If I assign the whole Vector2 to a variable, it will work as expected, and accessing the member variables will give me the expected value.</p>
  
  <p>I managed to reproduce the problem with as minimum code as I could, getting rid of the physics engine and everything else I was using.</p>
  
  <p>Here is the c++ code:</p>
  
  <pre><code>//test.cpp
  #include &lt;chaiscript/chaiscript.hpp&gt;
  #include &lt;chaiscript/chaiscript_stdlib.hpp&gt;
  
  template&lt;typename T&gt;
  struct Vector2
  {
    Vector2() : x(0), y(0) {};
    Vector2(T px, T py) : x(px), y(py) {};
    Vector2(const Vector2&amp; cp) : x(cp.x), y(cp.y) {};
  
    Vector2&amp; operator+=(const Vector2&amp; vec_r)
   {
    x += vec_r.x;
    y += vec_r.y;
    return *this;
   }
  
   Vector2 operator+(const Vector2&amp; vec_r)
   {
    return Vector2(*this += vec_r);
   }
  
   void operator=(const Vector2&amp; ver_r)
   {
    x = ver_r.x;
    y = ver_r.y;
   }
  
  
   T x;
   T y;
  };
  
  Vector2&lt;float&gt; GetValue()
  {
      return Vector2&lt;float&gt;(10,15);
  }
  
  int main()
  {
    chaiscript::ChaiScript _script(chaiscript::Std_Lib::library());
  
   //Registering stuff
   _script.add(chaiscript::user_type&lt;Vector2&lt;float&gt;&gt;(), "Vector2f");
   _script.add(chaiscript::constructor&lt;Vector2&lt;float&gt; ()&gt;(), "Vector2f");
   _script.add(chaiscript::constructor&lt;Vector2&lt;float&gt; (float, float)&gt;(), "Vector2f");
   _script.add(chaiscript::constructor&lt;Vector2&lt;float&gt; (const Vector2&lt;float&gt;&amp;)&gt;(), "Vector2f");
   _script.add(chaiscript::fun(&amp;Vector2&lt;float&gt;::x), "x");
   _script.add(chaiscript::fun(&amp;Vector2&lt;float&gt;::y), "y");
   _script.add(chaiscript::fun(&amp;Vector2&lt;float&gt;::operator +), "+");
   _script.add(chaiscript::fun(&amp;Vector2&lt;float&gt;::operator +=), "+=");
   _script.add(chaiscript::fun(&amp;Vector2&lt;float&gt;::operator =), "=");
   _script.add(chaiscript::fun(&amp;GetValue), "getValue");
  
   _script.eval_file("test.chai");
  
   return 0;
  }
  </code></pre>
  
  <p>And here is the script:</p>
  
  <pre><code>//test.chai
  var test = 0.0
  var test2 = Vector2f(10,10)
  
  
   test = getValue().x
   print(test)
   print(test2.x)
  </code></pre>
  
  <p>This code will reproduce the following:
  6.52556e-38
  10</p>
  
  <p>This value from getValue().x (6.52556e-38) is actually different each time I run the code, but it will usually be some crazy value between 1.f~8.f that goes to exponential -36~-38.</p>
  
  <p>I can get around this problem by using "var something = getValue()", and then accessing "something.x", but it would be helpful to understand why that happens and how I could get it fixed.</p>