title: boost make_shared takes in a const reference. Any way to get around this?
body: <p>I am using boost shared pointers in my program, and I have a class that takes as a parameters a reference to another object.  The problem I am running into is the make_shared function requires all parameters to be a const reference, and I get compile errors if my class's constructor doesn't allow const reference parameters to be passed in.</p>
  
  <p>Does anyone know the reason behind this?  Also, is there anything I can do to get around this?</p>
  
  <p>code example of what is giving me problems:</p>
  
  <pre><code>class Object
  {
    public:
      Object(int&amp; i)
      {
        i = 2;
      }
  };
  
  
  int main(int argc, char *argv[])
  {
    int i = 0;
    boost::shared_ptr&lt;Object&gt; obj = boost::make_shared&lt;Object&gt;(i);
    return 1;
  }
  </code></pre>
  
  <p>This results in a compiler error that states the following</p>
  
  <p>:make_shared.hpp:185: error: no matching function for call to `Object::Object(const int&amp;)'
  note: candidates are: Object::Object(const Object&amp;)
  note:                 Object::Object(int&amp;)</p>
  
  <p>If the parameter to Objects constructor is a const int, this works.  I am curious as to why make_shared behaves this way.</p>