Boost logo

Boost Users :

Subject: Re: [Boost-users] [SmartPtr] shared_ptr as a default value in function template
From: Igor R (boost.lists_at_[hidden])
Date: 2013-05-23 09:40:52


> It seems to be a MSVC related issue; Unless the templated function
> (make_shared in this case) is in the same namespace as the called templated
> function (f in this case) MSVC throws an error.

Good finding, thanks!

Note however that the following does compile in MSVC:

#include <boost/shared_ptr.hpp>
#include <boost/make_shared.hpp>
void f(int, boost::shared_ptr<int> = boost::make_shared<int>())
{ }
int main()
{
  f(0);
}

So, it's still unclear in what cases exactly this bug occurs.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net