Closed octopus-prime closed 7 years ago
Thanks, Mike, for trying it out. To figure it out what went wrong, could you please (for starters)
1) build it with -std=c++11 (that's how I build); 2) try building impl_ptr/test (as it builds for me).
That way we'll quickly pin-point the problem and will move forward. Tnx.
On Thu, Aug 17, 2017 at 5:20 AM, Mike Gresens notifications@github.com wrote:
Hi!
Want to try your library - since you want a boost review. So I cloned this project. Tried to take something from your examples. Tried to build -> compiler errors...
include
include
using std::string;
struct Book : impl_ptr
::shared { Book(string const& title, string const& author); string const& title() const; string const& author() const; };
template<> struct impl_ptr
::implementation { implementation(string const& the_title, string const& the_author) : title(the_title), author(the_author) {} string title; string author; }; Book::Book(string const& title, string const& author) : impl_ptr_type(in_place, title, author) {}
string const& Book::title () const { return (this)->title; } string const& Book::author () const { return (this)->author; }
==>
gcc.compile.c++ bin/gcc-7/release/source/test_pimpl.o
"g++" -ftemplate-depth-128 -march=native -ftemplate-depth=256 -std=c++17 -O3 -finline-functions -Wno-inline -Wall -fPIC -DBOOST_ALL_DYN_LINK -DNDEBUG -I"/home/mike/workspace/pimpl/include" -I"include" -c -o "bin/gcc-7/release/source/test_pimpl.o" "source/test_pimpl.cpp"
In file included from source/test_pimpl.cpp:8:0: /home/mike/workspace/pimpl/include/impl_ptr.hpp: In member function ‘void impl_ptr
::base< >::emplace(arg_types&& ...)’: /home/mike/workspace/pimpl/include/implptr.hpp:96:32: error: expected primary-expression before ‘>’ token impl.emplace (std::forward (args)...); ^ /home/mike/workspace/pimpl/include/implptr.hpp:96:66: error: expected binary operator before ‘)’ token impl.emplace (std::forward (args)...); ^ /home/mike/workspace/pimpl/include/impl_ptr.hpp: In member function ‘void impl_ptr ::base< >::emplace(arg_types&& ...)’: /home/mike/workspace/pimpl/include/implptr.hpp:102:37: error: expected primary-expression before ‘>’ token impl.emplace (std::forward (args)...); ^ /home/mike/workspace/pimpl/include/implptr.hpp:102:71: error: expected binary operator before ‘)’ token impl.emplace (std::forward (args)...); ^ /home/mike/workspace/pimpl/include/impl_ptr.hpp: In constructor ‘impl_ptr ::base< >::base(detail::in_place_type, arg_types&& ...)’: /home/mike/workspace/pimpl/include/implptr.hpp:128:37: error: expected primary-expression before ‘>’ token impl.emplace (std::forward (args)...); ^ /home/mike/workspace/pimpl/include/implptr.hpp:128:71: error: expected binary operator before ‘)’ token impl.emplace (std::forward (args)...); ^ ...failed gcc.compile.c++ bin/gcc-7/release/source/test_pimpl.o... — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/yet-another-user/pimpl/issues/2, or mute the thread https://github.com/notifications/unsubscribe-auth/ABswIFMq50WP57Dp4RVSL0t1zJKdcpuOks5sY0D2gaJpZM4O5XFt .
Still errors (building test with gcc 7 in C++11)
mike@workstation:~/workspace/pimpl$ bjam release -j16
...found 36 targets...
...updating 12 targets...
common.mkdir bin
common.mkdir bin/gcc-7
common.mkdir bin/gcc-7/release
common.mkdir bin/gcc-7/release/test
gcc.compile.c++ bin/gcc-7/release/test/impl_onstack.o
In file included from test/./test.hpp:4:0,
from test/impl_onstack.cpp:1:
test/./../include/impl_ptr.hpp: In member function ‘void impl_ptr<user_type>::base< <template-parameter-2-1> >::emplace(arg_types&& ...)’:
test/./../include/impl_ptr.hpp:96:32: error: expected primary-expression before ‘>’ token
impl_.emplace<impl_type>(std::forward<arg_types>(args)...);
^
test/./../include/impl_ptr.hpp:96:66: error: expected binary operator before ‘)’ token
impl_.emplace<impl_type>(std::forward<arg_types>(args)...);
^
test/./../include/impl_ptr.hpp: In member function ‘void impl_ptr<user_type>::base< <template-parameter-2-1> >::emplace(arg_types&& ...)’:
test/./../include/impl_ptr.hpp:102:37: error: expected primary-expression before ‘>’ token
impl_.emplace<implementation>(std::forward<arg_types>(args)...);
^
test/./../include/impl_ptr.hpp:102:71: error: expected binary operator before ‘)’ token
impl_.emplace<implementation>(std::forward<arg_types>(args)...);
^
test/./../include/impl_ptr.hpp: In constructor ‘impl_ptr<user_type>::base< <template-parameter-2-1> >::base(detail::in_place_type, arg_types&& ...)’:
test/./../include/impl_ptr.hpp:128:37: error: expected primary-expression before ‘>’ token
impl_.emplace<implementation>(std::forward<arg_types>(args)...);
^
test/./../include/impl_ptr.hpp:128:71: error: expected binary operator before ‘)’ token
impl_.emplace<implementation>(std::forward<arg_types>(args)...);
^
"g++" -ftemplate-depth-128 -march=native -ftemplate-depth=256 -std=c++11 -O3 -finline-functions -Wno-inline -Wall -fPIC -DBOOST_ALL_DYN_LINK -DNDEBUG -I"include" -c -o "bin/gcc-7/release/test/impl_onstack.o" "test/impl_onstack.cpp"
...failed gcc.compile.c++ bin/gcc-7/release/test/impl_onstack.o...
gcc.compile.c++ bin/gcc-7/release/test/impl_poly.o
In file included from test/./test.hpp:4:0,
from test/impl_poly.cpp:1:
test/./../include/impl_ptr.hpp: In member function ‘void impl_ptr<user_type>::base< <template-parameter-2-1> >::emplace(arg_types&& ...)’:
test/./../include/impl_ptr.hpp:96:32: error: expected primary-expression before ‘>’ token
impl_.emplace<impl_type>(std::forward<arg_types>(args)...);
^
test/./../include/impl_ptr.hpp:96:66: error: expected binary operator before ‘)’ token
impl_.emplace<impl_type>(std::forward<arg_types>(args)...);
^
test/./../include/impl_ptr.hpp: In member function ‘void impl_ptr<user_type>::base< <template-parameter-2-1> >::emplace(arg_types&& ...)’:
test/./../include/impl_ptr.hpp:102:37: error: expected primary-expression before ‘>’ token
impl_.emplace<implementation>(std::forward<arg_types>(args)...);
^
test/./../include/impl_ptr.hpp:102:71: error: expected binary operator before ‘)’ token
impl_.emplace<implementation>(std::forward<arg_types>(args)...);
^
test/./../include/impl_ptr.hpp: In constructor ‘impl_ptr<user_type>::base< <template-parameter-2-1> >::base(detail::in_place_type, arg_types&& ...)’:
test/./../include/impl_ptr.hpp:128:37: error: expected primary-expression before ‘>’ token
impl_.emplace<implementation>(std::forward<arg_types>(args)...);
^
test/./../include/impl_ptr.hpp:128:71: error: expected binary operator before ‘)’ token
impl_.emplace<implementation>(std::forward<arg_types>(args)...);
^
"g++" -ftemplate-depth-128 -march=native -ftemplate-depth=256 -std=c++11 -O3 -finline-functions -Wno-inline -Wall -fPIC -DBOOST_ALL_DYN_LINK -DNDEBUG -I"include" -c -o "bin/gcc-7/release/test/impl_poly.o" "test/impl_poly.cpp"
...failed gcc.compile.c++ bin/gcc-7/release/test/impl_poly.o...
gcc.compile.c++ bin/gcc-7/release/test/impl_copied.o
In file included from test/./test.hpp:4:0,
from test/impl_copied.cpp:1:
test/./../include/impl_ptr.hpp: In member function ‘void impl_ptr<user_type>::base< <template-parameter-2-1> >::emplace(arg_types&& ...)’:
test/./../include/impl_ptr.hpp:96:32: error: expected primary-expression before ‘>’ token
impl_.emplace<impl_type>(std::forward<arg_types>(args)...);
^
test/./../include/impl_ptr.hpp:96:66: error: expected binary operator before ‘)’ token
impl_.emplace<impl_type>(std::forward<arg_types>(args)...);
^
test/./../include/impl_ptr.hpp: In member function ‘void impl_ptr<user_type>::base< <template-parameter-2-1> >::emplace(arg_types&& ...)’:
test/./../include/impl_ptr.hpp:102:37: error: expected primary-expression before ‘>’ token
impl_.emplace<implementation>(std::forward<arg_types>(args)...);
^
test/./../include/impl_ptr.hpp:102:71: error: expected binary operator before ‘)’ token
impl_.emplace<implementation>(std::forward<arg_types>(args)...);
^
test/./../include/impl_ptr.hpp: In constructor ‘impl_ptr<user_type>::base< <template-parameter-2-1> >::base(detail::in_place_type, arg_types&& ...)’:
test/./../include/impl_ptr.hpp:128:37: error: expected primary-expression before ‘>’ token
impl_.emplace<implementation>(std::forward<arg_types>(args)...);
^
test/./../include/impl_ptr.hpp:128:71: error: expected binary operator before ‘)’ token
impl_.emplace<implementation>(std::forward<arg_types>(args)...);
^
"g++" -ftemplate-depth-128 -march=native -ftemplate-depth=256 -std=c++11 -O3 -finline-functions -Wno-inline -Wall -fPIC -DBOOST_ALL_DYN_LINK -DNDEBUG -I"include" -c -o "bin/gcc-7/release/test/impl_copied.o" "test/impl_copied.cpp"
...failed gcc.compile.c++ bin/gcc-7/release/test/impl_copied.o...
gcc.compile.c++ bin/gcc-7/release/test/impl.o
In file included from test/./test.hpp:4:0,
from test/impl.cpp:1:
test/./../include/impl_ptr.hpp: In member function ‘void impl_ptr<user_type>::base< <template-parameter-2-1> >::emplace(arg_types&& ...)’:
test/./../include/impl_ptr.hpp:96:32: error: expected primary-expression before ‘>’ token
impl_.emplace<impl_type>(std::forward<arg_types>(args)...);
^
test/./../include/impl_ptr.hpp:96:66: error: expected binary operator before ‘)’ token
impl_.emplace<impl_type>(std::forward<arg_types>(args)...);
^
test/./../include/impl_ptr.hpp: In member function ‘void impl_ptr<user_type>::base< <template-parameter-2-1> >::emplace(arg_types&& ...)’:
test/./../include/impl_ptr.hpp:102:37: error: expected primary-expression before ‘>’ token
impl_.emplace<implementation>(std::forward<arg_types>(args)...);
^
test/./../include/impl_ptr.hpp:102:71: error: expected binary operator before ‘)’ token
impl_.emplace<implementation>(std::forward<arg_types>(args)...);
^
test/./../include/impl_ptr.hpp: In constructor ‘impl_ptr<user_type>::base< <template-parameter-2-1> >::base(detail::in_place_type, arg_types&& ...)’:
test/./../include/impl_ptr.hpp:128:37: error: expected primary-expression before ‘>’ token
impl_.emplace<implementation>(std::forward<arg_types>(args)...);
^
test/./../include/impl_ptr.hpp:128:71: error: expected binary operator before ‘)’ token
impl_.emplace<implementation>(std::forward<arg_types>(args)...);
^
"g++" -ftemplate-depth-128 -march=native -ftemplate-depth=256 -std=c++11 -O3 -finline-functions -Wno-inline -Wall -fPIC -DBOOST_ALL_DYN_LINK -DNDEBUG -I"include" -c -o "bin/gcc-7/release/test/impl.o" "test/impl.cpp"
...failed gcc.compile.c++ bin/gcc-7/release/test/impl.o...
gcc.compile.c++ bin/gcc-7/release/test/impl_shared.o
In file included from test/./test.hpp:4:0,
from test/impl_shared.cpp:1:
test/./../include/impl_ptr.hpp: In member function ‘void impl_ptr<user_type>::base< <template-parameter-2-1> >::emplace(arg_types&& ...)’:
test/./../include/impl_ptr.hpp:96:32: error: expected primary-expression before ‘>’ token
impl_.emplace<impl_type>(std::forward<arg_types>(args)...);
^
test/./../include/impl_ptr.hpp:96:66: error: expected binary operator before ‘)’ token
impl_.emplace<impl_type>(std::forward<arg_types>(args)...);
^
test/./../include/impl_ptr.hpp: In member function ‘void impl_ptr<user_type>::base< <template-parameter-2-1> >::emplace(arg_types&& ...)’:
test/./../include/impl_ptr.hpp:102:37: error: expected primary-expression before ‘>’ token
impl_.emplace<implementation>(std::forward<arg_types>(args)...);
^
test/./../include/impl_ptr.hpp:102:71: error: expected binary operator before ‘)’ token
impl_.emplace<implementation>(std::forward<arg_types>(args)...);
^
test/./../include/impl_ptr.hpp: In constructor ‘impl_ptr<user_type>::base< <template-parameter-2-1> >::base(detail::in_place_type, arg_types&& ...)’:
test/./../include/impl_ptr.hpp:128:37: error: expected primary-expression before ‘>’ token
impl_.emplace<implementation>(std::forward<arg_types>(args)...);
^
test/./../include/impl_ptr.hpp:128:71: error: expected binary operator before ‘)’ token
impl_.emplace<implementation>(std::forward<arg_types>(args)...);
^
test/impl_shared.cpp: In constructor ‘Shared::Shared(test::singleton_type)’:
test/impl_shared.cpp:52:19: warning: unused variable ‘inited’ [-Wunused-variable]
static bool inited = (single.emplace(), true);
^~~~~~
"g++" -ftemplate-depth-128 -march=native -ftemplate-depth=256 -std=c++11 -O3 -finline-functions -Wno-inline -Wall -fPIC -DBOOST_ALL_DYN_LINK -DNDEBUG -I"include" -c -o "bin/gcc-7/release/test/impl_shared.o" "test/impl_shared.cpp"
...failed gcc.compile.c++ bin/gcc-7/release/test/impl_shared.o...
gcc.compile.c++ bin/gcc-7/release/test/main.o
In file included from test/./test.hpp:4:0,
from test/main.cpp:1:
test/./../include/impl_ptr.hpp: In member function ‘void impl_ptr<user_type>::base< <template-parameter-2-1> >::emplace(arg_types&& ...)’:
test/./../include/impl_ptr.hpp:96:32: error: expected primary-expression before ‘>’ token
impl_.emplace<impl_type>(std::forward<arg_types>(args)...);
^
test/./../include/impl_ptr.hpp:96:66: error: expected binary operator before ‘)’ token
impl_.emplace<impl_type>(std::forward<arg_types>(args)...);
^
test/./../include/impl_ptr.hpp: In member function ‘void impl_ptr<user_type>::base< <template-parameter-2-1> >::emplace(arg_types&& ...)’:
test/./../include/impl_ptr.hpp:102:37: error: expected primary-expression before ‘>’ token
impl_.emplace<implementation>(std::forward<arg_types>(args)...);
^
test/./../include/impl_ptr.hpp:102:71: error: expected binary operator before ‘)’ token
impl_.emplace<implementation>(std::forward<arg_types>(args)...);
^
test/./../include/impl_ptr.hpp: In constructor ‘impl_ptr<user_type>::base< <template-parameter-2-1> >::base(detail::in_place_type, arg_types&& ...)’:
test/./../include/impl_ptr.hpp:128:37: error: expected primary-expression before ‘>’ token
impl_.emplace<implementation>(std::forward<arg_types>(args)...);
^
test/./../include/impl_ptr.hpp:128:71: error: expected binary operator before ‘)’ token
impl_.emplace<implementation>(std::forward<arg_types>(args)...);
^
"g++" -ftemplate-depth-128 -march=native -ftemplate-depth=256 -std=c++11 -O3 -finline-functions -Wno-inline -Wall -fPIC -DBOOST_ALL_DYN_LINK -DNDEBUG -I"include" -c -o "bin/gcc-7/release/test/main.o" "test/main.cpp"
...failed gcc.compile.c++ bin/gcc-7/release/test/main.o...
...skipped <pbin/gcc-7/release>pimpl-test for lack of <pbin/gcc-7/release>test/main.o...
...skipped <pbin/gcc-7/release>pimpl-test.passed for lack of <pbin/gcc-7/release>pimpl-test...
...failed updating 6 targets...
Here gcc 6:
mike@workstation:~/workspace/pimpl$ bjam release -j16
...found 36 targets...
...updating 3 targets...
gcc.compile.c++ bin/gcc-6/release/test/impl_onstack.o
In file included from test/./../include/impl_ptr.hpp:11:0,
from test/./test.hpp:4,
from test/impl_onstack.cpp:1:
test/./../include/./detail/onstack.hpp: In instantiation of ‘void detail::onstack< <template-parameter-1-1>, <anonymous> >::emplace(arg_types&& ...) [with derived_type = impl_ptr<OnStack>::implementation; arg_types = {}; impl_type = impl_ptr<OnStack>::implementation; long unsigned int sz = 32ul]’:
test/./../include/impl_ptr.hpp:128:9: required from ‘impl_ptr<user_type>::base< <template-parameter-2-1> >::base(detail::in_place_type, arg_types&& ...) [with arg_types = {}; policy_type = detail::onstack<impl_ptr<OnStack>::implementation, 32ul>; user_type = OnStack]’
test/impl_onstack.cpp:28:50: required from here
test/./../include/./detail/onstack.hpp:16:9: error: static assertion failed
static_assert(sizeof(derived_type) <= sz, "");
^~~~~~~~~~~~~
test/./../include/./detail/onstack.hpp:18:9: warning: placement new constructing an object of type ‘impl_ptr<OnStack>::implementation’ and size ‘40’ in a region of type ‘detail::onstack<impl_ptr<OnStack>::implementation, 32ul>::buffer {aka char [32]}’ and size ‘32’ [-Wplacement-new=]
new (storage_) derived_type(std::forward<arg_types>(args)...);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test/./../include/./detail/onstack.hpp: In instantiation of ‘void detail::onstack< <template-parameter-1-1>, <anonymous> >::emplace(arg_types&& ...) [with derived_type = impl_ptr<OnStack>::implementation; arg_types = {int&}; impl_type = impl_ptr<OnStack>::implementation; long unsigned int sz = 32ul]’:
test/./../include/impl_ptr.hpp:128:9: required from ‘impl_ptr<user_type>::base< <template-parameter-2-1> >::base(detail::in_place_type, arg_types&& ...) [with arg_types = {int&}; policy_type = detail::onstack<impl_ptr<OnStack>::implementation, 32ul>; user_type = OnStack]’
test/impl_onstack.cpp:29:53: required from here
test/./../include/./detail/onstack.hpp:16:9: error: static assertion failed
static_assert(sizeof(derived_type) <= sz, "");
^~~~~~~~~~~~~
test/./../include/./detail/onstack.hpp:18:9: warning: placement new constructing an object of type ‘impl_ptr<OnStack>::implementation’ and size ‘40’ in a region of type ‘detail::onstack<impl_ptr<OnStack>::implementation, 32ul>::buffer {aka char [32]}’ and size ‘32’ [-Wplacement-new=]
new (storage_) derived_type(std::forward<arg_types>(args)...);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"g++-6" -ftemplate-depth-128 -march=native -ftemplate-depth=256 -std=c++11 -O3 -finline-functions -Wno-inline -Wall -fPIC -DBOOST_ALL_DYN_LINK -DNDEBUG -I"include" -c -o "bin/gcc-6/release/test/impl_onstack.o" "test/impl_onstack.cpp"
...failed gcc.compile.c++ bin/gcc-6/release/test/impl_onstack.o...
...skipped <pbin/gcc-6/release>pimpl-test for lack of <pbin/gcc-6/release>test/impl_onstack.o...
...skipped <pbin/gcc-6/release>pimpl-test.passed for lack of <pbin/gcc-6/release>pimpl-test...
...failed updating 1 target...
...skipped 2 targets...
mike@workstation:~/workspace/pimpl$
clang 4 with c++11:
mike@workstation:~/workspace/pimpl$ bjam release -j16
...found 36 targets...
...updating 11 targets...
common.mkdir bin/clang-linux-4.0.0
common.mkdir bin/clang-linux-4.0.0/release
common.mkdir bin/clang-linux-4.0.0/release/test
clang-linux.compile.c++.without-pth bin/clang-linux-4.0.0/release/test/impl_onstack.o
In file included from test/impl_onstack.cpp:1:
In file included from test/./test.hpp:4:
test/../include/impl_ptr.hpp:119:31: warning: class template 'impl_ptr' was previously declared as a struct template [-Wmismatched-tags]
template<typename> friend class impl_ptr;
^
test/../include/impl_ptr.hpp:21:8: note: previous use is here
struct impl_ptr
^
test/../include/impl_ptr.hpp:119:31: note: did you mean struct here?
template<typename> friend class impl_ptr;
^~~~~
struct
test/../include/impl_ptr.hpp:96:15: error: use 'template' keyword to treat 'emplace' as a dependent template name
impl_.emplace<impl_type>(std::forward<arg_types>(args)...);
^
template
test/../include/impl_ptr.hpp:102:15: error: use 'template' keyword to treat 'emplace' as a dependent template name
impl_.emplace<implementation>(std::forward<arg_types>(args)...);
^
template
test/../include/impl_ptr.hpp:128:15: error: use 'template' keyword to treat 'emplace' as a dependent template name
impl_.emplace<implementation>(std::forward<arg_types>(args)...);
^
template
In file included from test/impl_onstack.cpp:1:
In file included from test/./test.hpp:4:
In file included from test/../include/impl_ptr.hpp:11:
include/./detail/onstack.hpp:16:9: error: static_assert failed ""
static_assert(sizeof(derived_type) <= sz, "");
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
test/../include/impl_ptr.hpp:128:15: note: in instantiation of function template specialization 'detail::onstack<impl_ptr<OnStack>::implementation, 32>::emplace<impl_ptr<OnStack>::implementation>' requested here
impl_.emplace<implementation>(std::forward<arg_types>(args)...);
^
test/impl_onstack.cpp:28:28: note: in instantiation of function template specialization 'impl_ptr<OnStack>::base<detail::onstack<impl_ptr<OnStack>::implementation, 32> >::base<>' requested here
OnStack::OnStack () : impl_ptr_type(in_place) {}
^
In file included from test/impl_onstack.cpp:1:
In file included from test/./test.hpp:4:
In file included from test/../include/impl_ptr.hpp:11:
include/./detail/onstack.hpp:16:9: error: static_assert failed ""
static_assert(sizeof(derived_type) <= sz, "");
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
test/../include/impl_ptr.hpp:128:15: note: in instantiation of function template specialization 'detail::onstack<impl_ptr<OnStack>::implementation, 32>::emplace<impl_ptr<OnStack>::implementation, int &>' requested here
impl_.emplace<implementation>(std::forward<arg_types>(args)...);
^
test/impl_onstack.cpp:29:28: note: in instantiation of function template specialization 'impl_ptr<OnStack>::base<detail::onstack<impl_ptr<OnStack>::implementation, 32> >::base<int &>' requested here
OnStack::OnStack (int k) : impl_ptr_type(in_place, k) {}
^
1 warning and 5 errors generated.
"clang++" -c -x c++ -march=native -std=c++11 -O3 -Wno-inline -Wall -fPIC -DBOOST_ALL_DYN_LINK -DNDEBUG -I"include" -o "bin/clang-linux-4.0.0/release/test/impl_onstack.o" "test/impl_onstack.cpp"
...failed clang-linux.compile.c++.without-pth bin/clang-linux-4.0.0/release/test/impl_onstack.o...
clang-linux.compile.c++.without-pth bin/clang-linux-4.0.0/release/test/impl_copied.o
In file included from test/impl_copied.cpp:1:
In file included from test/./test.hpp:4:
test/../include/impl_ptr.hpp:119:31: warning: class template 'impl_ptr' was previously declared as a struct template [-Wmismatched-tags]
template<typename> friend class impl_ptr;
^
test/../include/impl_ptr.hpp:21:8: note: previous use is here
struct impl_ptr
^
test/../include/impl_ptr.hpp:119:31: note: did you mean struct here?
template<typename> friend class impl_ptr;
^~~~~
struct
test/../include/impl_ptr.hpp:96:15: error: use 'template' keyword to treat 'emplace' as a dependent template name
impl_.emplace<impl_type>(std::forward<arg_types>(args)...);
^
template
test/../include/impl_ptr.hpp:102:15: error: use 'template' keyword to treat 'emplace' as a dependent template name
impl_.emplace<implementation>(std::forward<arg_types>(args)...);
^
template
test/../include/impl_ptr.hpp:128:15: error: use 'template' keyword to treat 'emplace' as a dependent template name
impl_.emplace<implementation>(std::forward<arg_types>(args)...);
^
template
1 warning and 3 errors generated.
"clang++" -c -x c++ -march=native -std=c++11 -O3 -Wno-inline -Wall -fPIC -DBOOST_ALL_DYN_LINK -DNDEBUG -I"include" -o "bin/clang-linux-4.0.0/release/test/impl_copied.o" "test/impl_copied.cpp"
...failed clang-linux.compile.c++.without-pth bin/clang-linux-4.0.0/release/test/impl_copied.o...
clang-linux.compile.c++.without-pth bin/clang-linux-4.0.0/release/test/impl.o
In file included from test/impl.cpp:1:
In file included from test/./test.hpp:4:
test/../include/impl_ptr.hpp:119:31: warning: class template 'impl_ptr' was previously declared as a struct template [-Wmismatched-tags]
template<typename> friend class impl_ptr;
^
test/../include/impl_ptr.hpp:21:8: note: previous use is here
struct impl_ptr
^
test/../include/impl_ptr.hpp:119:31: note: did you mean struct here?
template<typename> friend class impl_ptr;
^~~~~
struct
test/../include/impl_ptr.hpp:96:15: error: use 'template' keyword to treat 'emplace' as a dependent template name
impl_.emplace<impl_type>(std::forward<arg_types>(args)...);
^
template
test/../include/impl_ptr.hpp:102:15: error: use 'template' keyword to treat 'emplace' as a dependent template name
impl_.emplace<implementation>(std::forward<arg_types>(args)...);
^
template
test/../include/impl_ptr.hpp:128:15: error: use 'template' keyword to treat 'emplace' as a dependent template name
impl_.emplace<implementation>(std::forward<arg_types>(args)...);
^
template
1 warning and 3 errors generated.
"clang++" -c -x c++ -march=native -std=c++11 -O3 -Wno-inline -Wall -fPIC -DBOOST_ALL_DYN_LINK -DNDEBUG -I"include" -o "bin/clang-linux-4.0.0/release/test/impl.o" "test/impl.cpp"
...failed clang-linux.compile.c++.without-pth bin/clang-linux-4.0.0/release/test/impl.o...
clang-linux.compile.c++.without-pth bin/clang-linux-4.0.0/release/test/impl_poly.o
In file included from test/impl_poly.cpp:1:
In file included from test/./test.hpp:4:
test/../include/impl_ptr.hpp:119:31: warning: class template 'impl_ptr' was previously declared as a struct template [-Wmismatched-tags]
template<typename> friend class impl_ptr;
^
test/../include/impl_ptr.hpp:21:8: note: previous use is here
struct impl_ptr
^
test/../include/impl_ptr.hpp:119:31: note: did you mean struct here?
template<typename> friend class impl_ptr;
^~~~~
struct
test/../include/impl_ptr.hpp:96:15: error: use 'template' keyword to treat 'emplace' as a dependent template name
impl_.emplace<impl_type>(std::forward<arg_types>(args)...);
^
template
test/../include/impl_ptr.hpp:102:15: error: use 'template' keyword to treat 'emplace' as a dependent template name
impl_.emplace<implementation>(std::forward<arg_types>(args)...);
^
template
test/../include/impl_ptr.hpp:128:15: error: use 'template' keyword to treat 'emplace' as a dependent template name
impl_.emplace<implementation>(std::forward<arg_types>(args)...);
^
template
test/../include/impl_ptr.hpp:47:9: error: static_assert failed ""
static_assert(impl_ptr<user_type>::value, "");
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
test/../include/impl_ptr.hpp:115:61: note: in instantiation of member function 'impl_ptr<Base>::null' requested here
static user_type null() { return impl_ptr< user_type>::null(); }
^
test/impl_poly.cpp:64:41: note: in instantiation of member function 'impl_ptr<Base>::base<detail::shared<impl_ptr<Base>::implementation> >::null' requested here
Derived1::Derived1(int k, int l) : Base(null())
^
1 warning and 4 errors generated.
"clang++" -c -x c++ -march=native -std=c++11 -O3 -Wno-inline -Wall -fPIC -DBOOST_ALL_DYN_LINK -DNDEBUG -I"include" -o "bin/clang-linux-4.0.0/release/test/impl_poly.o" "test/impl_poly.cpp"
...failed clang-linux.compile.c++.without-pth bin/clang-linux-4.0.0/release/test/impl_poly.o...
clang-linux.compile.c++.without-pth bin/clang-linux-4.0.0/release/test/impl_shared.o
In file included from test/impl_shared.cpp:1:
In file included from test/./test.hpp:4:
test/../include/impl_ptr.hpp:119:31: warning: class template 'impl_ptr' was previously declared as a struct template [-Wmismatched-tags]
template<typename> friend class impl_ptr;
^
test/../include/impl_ptr.hpp:21:8: note: previous use is here
struct impl_ptr
^
test/../include/impl_ptr.hpp:119:31: note: did you mean struct here?
template<typename> friend class impl_ptr;
^~~~~
struct
test/../include/impl_ptr.hpp:96:15: error: use 'template' keyword to treat 'emplace' as a dependent template name
impl_.emplace<impl_type>(std::forward<arg_types>(args)...);
^
template
test/../include/impl_ptr.hpp:102:15: error: use 'template' keyword to treat 'emplace' as a dependent template name
impl_.emplace<implementation>(std::forward<arg_types>(args)...);
^
template
test/../include/impl_ptr.hpp:128:15: error: use 'template' keyword to treat 'emplace' as a dependent template name
impl_.emplace<implementation>(std::forward<arg_types>(args)...);
^
template
test/impl_shared.cpp:52:19: warning: unused variable 'inited' [-Wunused-variable]
static bool inited = (single.emplace(), true);
^
In file included from test/impl_shared.cpp:1:
In file included from test/./test.hpp:4:
test/../include/impl_ptr.hpp:47:9: error: static_assert failed ""
static_assert(impl_ptr<user_type>::value, "");
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
test/../include/impl_ptr.hpp:115:61: note: in instantiation of member function 'impl_ptr<Shared>::null' requested here
static user_type null() { return impl_ptr< user_type>::null(); }
^
test/impl_shared.cpp:49:55: note: in instantiation of member function 'impl_ptr<Shared>::base<detail::shared<impl_ptr<Shared>::implementation> >::null' requested here
Shared::Shared (test::singleton_type) : impl_ptr_type(null())
^
2 warnings and 4 errors generated.
"clang++" -c -x c++ -march=native -std=c++11 -O3 -Wno-inline -Wall -fPIC -DBOOST_ALL_DYN_LINK -DNDEBUG -I"include" -o "bin/clang-linux-4.0.0/release/test/impl_shared.o" "test/impl_shared.cpp"
...failed clang-linux.compile.c++.without-pth bin/clang-linux-4.0.0/release/test/impl_shared.o...
clang-linux.compile.c++.without-pth bin/clang-linux-4.0.0/release/test/main.o
In file included from test/main.cpp:1:
In file included from test/./test.hpp:4:
test/../include/impl_ptr.hpp:119:31: warning: class template 'impl_ptr' was previously declared as a struct template [-Wmismatched-tags]
template<typename> friend class impl_ptr;
^
test/../include/impl_ptr.hpp:21:8: note: previous use is here
struct impl_ptr
^
test/../include/impl_ptr.hpp:119:31: note: did you mean struct here?
template<typename> friend class impl_ptr;
^~~~~
struct
test/../include/impl_ptr.hpp:96:15: error: use 'template' keyword to treat 'emplace' as a dependent template name
impl_.emplace<impl_type>(std::forward<arg_types>(args)...);
^
template
test/../include/impl_ptr.hpp:102:15: error: use 'template' keyword to treat 'emplace' as a dependent template name
impl_.emplace<implementation>(std::forward<arg_types>(args)...);
^
template
test/../include/impl_ptr.hpp:128:15: error: use 'template' keyword to treat 'emplace' as a dependent template name
impl_.emplace<implementation>(std::forward<arg_types>(args)...);
^
template
test/../include/impl_ptr.hpp:47:9: error: static_assert failed ""
static_assert(impl_ptr<user_type>::value, "");
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
test/main.cpp:132:43: note: in instantiation of member function 'impl_ptr<Shared>::null' requested here
Shared s01 = boost::impl_ptr<Shared>::null(); BOOST_TEST(s01.trace() == "null");
^
In file included from test/main.cpp:1:
In file included from test/./test.hpp:4:
test/../include/impl_ptr.hpp:47:9: error: static_assert failed ""
static_assert(impl_ptr<user_type>::value, "");
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
test/main.cpp:134:43: note: in instantiation of member function 'impl_ptr<Copied>::null' requested here
Copied c01 = boost::impl_ptr<Copied>::null(); BOOST_TEST(c01.trace() == "null");
^
In file included from test/main.cpp:1:
In file included from test/./test.hpp:4:
test/../include/impl_ptr.hpp:47:9: error: static_assert failed ""
static_assert(impl_ptr<user_type>::value, "");
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
test/main.cpp:137:46: note: in instantiation of member function 'impl_ptr<Base>::null' requested here
Base p03 (boost::impl_ptr< Base>::null()); BOOST_TEST(p03.trace() == "null");
^
In file included from test/main.cpp:1:
In file included from test/./test.hpp:4:
test/../include/impl_ptr.hpp:47:9: error: static_assert failed ""
static_assert(impl_ptr<user_type>::value, "");
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
test/../include/impl_ptr.hpp:115:61: note: in instantiation of member function 'impl_ptr<OnStack>::null' requested here
static user_type null() { return impl_ptr< user_type>::null(); }
^
test/main.cpp:233:28: note: in instantiation of member function 'impl_ptr<OnStack>::base<detail::onstack<impl_ptr<OnStack>::implementation, 32> >::null' requested here
OnStack s13 = OnStack::null();
^
1 warning and 7 errors generated.
"clang++" -c -x c++ -march=native -std=c++11 -O3 -Wno-inline -Wall -fPIC -DBOOST_ALL_DYN_LINK -DNDEBUG -I"include" -o "bin/clang-linux-4.0.0/release/test/main.o" "test/main.cpp"
...failed clang-linux.compile.c++.without-pth bin/clang-linux-4.0.0/release/test/main.o...
...skipped <pbin/clang-linux-4.0.0/release>pimpl-test for lack of <pbin/clang-linux-4.0.0/release>test/main.o...
...skipped <pbin/clang-linux-4.0.0/release>pimpl-test.passed for lack of <pbin/clang-linux-4.0.0/release>pimpl-test...
...failed updating 6 targets...
...skipped 2 targets...
...updated 3 targets...
mike@workstation:~/workspace/pimpl$
Tnx, Mike. I have clang (3.8.0-2ubuntu4). I'll try what you do. Will keep you posted.
Just pushed changes. Built and ran the test with clang-4.0.
clang --version clang version 4.0.0-1ubuntu1~16.04.2 (tags/RELEASE_400/rc1) Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/bin
Ok. I tried the changed stuff. Since I have no boost 1.64/1.65 I cannot use boost::void_t ?! By replacing boost::void_t by std::void_t (impl_ptr.hpp:132) I was able to build my motivating examples and your tests.
Thanks
Hi!
Want to try your library - since you want a boost review. So I cloned this project. Tried to take something from your examples. Tried to build -> compiler errors...
==>