std::make_shared as a default argument does not compile
- by Mark Bryant
In Visual C++ (2008 and 2010), the following code does not compile with the following error:
#include <memory>
void Foo( std::shared_ptr< int > test = ::std::make_shared< int >( 5 ) )
{
}
class P
{
void
Foo( std::shared_ptr< int > test = ::std::make_shared< int >( 5 ) )
{
}
};
error C2039:…