Created
November 6, 2013 01:10
-
-
Save berkus/7329238 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In file included from test.cpp:1: | |
In file included from /usr/include/c++/v1/memory:603: | |
/usr/include/c++/v1/tuple:267:11: error: rvalue reference to type 'test::private_tag' cannot bind to lvalue of type | |
'test::private_tag' | |
: value(__t.get()) | |
^ ~~~~~~~~~ | |
/usr/include/c++/v1/tuple:385:8: note: in instantiation of member function 'std::__1::__tuple_leaf<0, test::private_tag &&, | |
false>::__tuple_leaf' requested here | |
struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...> | |
^ | |
/usr/include/c++/v1/memory:4290:26: note: in instantiation of function template specialization | |
'std::__1::__shared_ptr_emplace<test, std::__1::allocator<test> >::__shared_ptr_emplace<test::private_tag>' requested | |
here | |
::new(__hold2.get()) _CntrlBlk(__a2, _VSTD::forward<_Args>(__args)...); | |
^ | |
/usr/include/c++/v1/memory:4649:29: note: in instantiation of function template specialization | |
'std::__1::shared_ptr<test>::make_shared<test::private_tag>' requested here | |
return shared_ptr<_Tp>::make_shared(_VSTD::forward<_Args>(__args)...); | |
^ | |
test.cpp:9:10: note: in instantiation of function template specialization 'std::__1::make_shared<test, test::private_tag>' | |
requested here | |
return make_shared<test>(private_tag()); | |
^ | |
In file included from test.cpp:1: | |
In file included from /usr/include/c++/v1/memory:603: | |
/usr/include/c++/v1/tuple:268:10: error: static_assert failed "Can not copy a tuple with rvalue reference member" | |
{static_assert(!is_rvalue_reference<_Hp>::value, "Can not copy a tuple with rvalue reference member");} | |
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
2 errors generated. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clang++ -std=c++11 -stdlib=libc++ test.cpp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <memory> | |
using namespace std; | |
class test { | |
struct private_tag {}; | |
public: | |
test(private_tag) {} | |
static shared_ptr<test> make_test() { | |
return make_shared<test>(private_tag()); | |
} | |
}; | |
int main() | |
{ | |
auto t = test::make_test(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment