Boost logo

Boost :

Subject: Re: [boost] Searching for Review Manager for reflection library without macro
From: degski (degski_at_[hidden])
Date: 2017-09-05 05:31:49


> On Thu, Aug 10, 2017 at 12:20 AM, Antony Polukhin via Boost <
> boost_at_[hidden]> wrote:
> >
> > Hello,
> >
> > PFR is a C++14 library that provides tuple-like methods for aggregate
> > initializables. Library has a set of predefined operators and useful
> > functions for everyday use. Works with user-defined types without any
> > macro or boilerplate code.
> >
> > Library: https://github.com/apolukhin/magic_get
> > Docs: http://apolukhin.github.io/magic_get/

Does this library need the latest boost develop?

When using the (develop-)code with 1.64, the "motivating" example gives the
following errors on VS2017 15.3.3 (/std::latest):

1>------ Rebuild All started: Project: pfr, Configuration: Release x64
------
1>pfr.cpp
1>z:\vc\x64\include\boost/pfr/detail/core14.hpp(54): warning C4554: '<<':
check operator precedence for possible error; use parentheses to clarify
precedence
1>z:\vc\x64\include\boost/pfr/detail/core14.hpp(58): warning C4554: '<<':
check operator precedence for possible error; use parentheses to clarify
precedence
1>z:\vc\x64\include\boost/pfr/detail/core14.hpp(62): warning C4554: '<<':
check operator precedence for possible error; use parentheses to clarify
precedence
1>z:\vc\x64\include\boost/pfr/detail/core14.hpp(67): warning C4554: '<<':
check operator precedence for possible error; use parentheses to clarify
precedence
1>z:\vc\x64\include\boost/pfr/detail/core14.hpp(72): warning C4554: '<<':
check operator precedence for possible error; use parentheses to clarify
precedence
1>z:\vc\x64\include\boost/pfr/detail/core14.hpp(77): warning C4554: '<<':
check operator precedence for possible error; use parentheses to clarify
precedence
1>z:\vc\x64\include\boost/pfr/flat/tuple_size.hpp(26): error C2039:
'size_v': is not a member of '`global namespace''
1>z:\vc\x64\include\boost/pfr/flat/tuple_size.hpp(26): error C2146: syntax
error: missing '>' before identifier 'size_v'
1>z:\vc\x64\include\boost/pfr/flat/tuple_size.hpp(26): error C2993:
'unknown-type': illegal type for non-type template parameter 'Index'
1>z:\vc\x64\include\boost/pfr/detail/detectors.hpp(33): error C2679: binary
'<<': no operator found which takes a right-hand operand of type 'const
my_struct' (or there is no acceptable conversion)
1>C:\Program Files (x86)\Microsoft Visual
Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\ostream(488): note:
could be 'std::basic_ostream<char,std::char_traits<char>>
&std::basic_ostream<char,std::char_traits<char>>::operator
<<(std::basic_streambuf<char,std::char_traits<char>> *)'
1>C:\Program Files (x86)\Microsoft Visual
Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\ostream(468): note:
or 'std::basic_ostream<char,std::char_traits<char>>
&std::basic_ostream<char,std::char_traits<char>>::operator <<(const void *)'
1>C:\Program Files (x86)\Microsoft Visual
Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\ostream(448): note:
or 'std::basic_ostream<char,std::char_traits<char>>
&std::basic_ostream<char,std::char_traits<char>>::operator <<(long double)'

<snip>

1>C:\Program Files (x86)\Microsoft Visual
Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\ostream(209): note:
or 'std::basic_ostream<char,std::char_traits<char>>
&std::basic_ostream<char,std::char_traits<char>>::operator <<(bool)'
1>C:\Program Files (x86)\Microsoft Visual
Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\ostream(203): note:
or 'std::basic_ostream<char,std::char_traits<char>>
&std::basic_ostream<char,std::char_traits<char>>::operator <<(std::ios_base
&(__cdecl *)(std::ios_base &))'
1>C:\Program Files (x86)\Microsoft Visual
Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\ostream(197): note:
or 'std::basic_ostream<char,std::char_traits<char>>
&std::basic_ostream<char,std::char_traits<char>>::operator
<<(std::basic_ios<char,std::char_traits<char>> &(__cdecl
*)(std::basic_ios<char,std::char_traits<char>> &))'
1>C:\Program Files (x86)\Microsoft Visual
Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\ostream(192): note:
or 'std::basic_ostream<char,std::char_traits<char>>
&std::basic_ostream<char,std::char_traits<char>>::operator
<<(std::basic_ostream<char,std::char_traits<char>> &(__cdecl
*)(std::basic_ostream<char,std::char_traits<char>> &))'
1>C:\Program Files (x86)\Microsoft Visual
Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\ostream(684): note:
or 'std::basic_ostream<char,std::char_traits<char>> &std::operator
<<<char,std::char_traits<char>>(std::basic_ostream<char,std::char_traits<char>>
&,const char *)'

<snip>

1>C:\Program Files (x86)\Microsoft Visual
Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\ostream(973): note:
or 'std::basic_ostream<char,std::char_traits<char>> &std::operator
<<<char,std::char_traits<char>,my_struct>(std::basic_ostream<char,std::char_traits<char>>
&&,const _Ty &)'
1> with
1> [
1> _Ty=my_struct
1> ]
1>C:\Program Files (x86)\Microsoft Visual
Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\ostream(1011):
note: or 'std::basic_ostream<char,std::char_traits<char>>
&std::operator
<<<char,std::char_traits<char>>(std::basic_ostream<char,std::char_traits<char>>
&,const std::error_code &)'
1>z:\vc\x64\include\boost/pfr/detail/detectors.hpp(33): note: while trying
to match the argument list
'(std::basic_ostream<char,std::char_traits<char>>, const my_struct)'
1>z:\vc\x64\include\boost/pfr/detail/detectors.hpp(21): note: see reference
to alias template instantiation
'ostreamable_detector<std::basic_ostream<char,std::char_traits<char>>&,Tright>'
being compiled
1> with
1> [
1> Tright=const my_struct &
1> ]
1>pfr.cpp(15): note: see reference to class template instantiation
'boost::pfr::detail::not_appliable<boost::pfr::detail::ostreamable_detector,std::basic_ostream<char,std::char_traits<char>>
&,const my_struct &>' being compiled
1>z:\vc\x64\include\boost/pfr/precise/ops.hpp(128): note: see reference to
function template instantiation
'std::enable_if<boost::pfr::detail::not_appliable<boost::pfr::detail::ostreamable_detector,Stream&,const
Type&>::value,Stream&>::type boost::pfr::ops::operator
<<(std::basic_ostream<_Elem,_Traits> &,const T &)' being compiled
1> with
1> [
1> Stream=std::basic_ostream<_Elem,_Traits>,
1> Type=T
1> ]
1>z:\vc\x64\include\boost/pfr/detail/detectors.hpp(33): error C2088: '<<':
illegal for class
1>Done building project "pfr.vcxproj" -- FAILED.

With clang/LLVM-6 (-std=c++2a), the following errors are generated:

1>------ Rebuild All started: Project: pfr, Configuration: Release x64
------
1>In file included from pfr.cpp:3:
1>In file included from z:\vc\x64\include\boost/pfr.hpp:12:
1>In file included from z:\vc\x64\include\boost/pfr/precise.hpp:12:
1>In file included from z:\vc\x64\include\boost/pfr/precise/core.hpp:20:
1>z:\vc\x64\include\boost/pfr/detail/core17.hpp(21): error : cannot
decompose this type; 'std::tuple_size<const
boost::pfr::detail::do_not_define_std_tuple_size_for_me>::value' is not a
valid integral constant expression
1>z:\vc\x64\include\boost/pfr/detail/core17.hpp(39): note: in
instantiation of function template specialization
'boost::pfr::detail::do_structured_bindings_work<boost::pfr::detail::do_not_define_std_tuple_size_for_me>'
requested here
1>z:\vc\x64\include\boost/pfr/detail/core17.hpp(39): error : static_assert
expression is not an integral constant expression
1>In file included from pfr.cpp:3:
1>In file included from z:\vc\x64\include\boost/pfr.hpp:12:
1>In file included from z:\vc\x64\include\boost/pfr/precise.hpp:12:
1>In file included from z:\vc\x64\include\boost/pfr/precise/core.hpp:20:
1>In file included from z:\vc\x64\include\boost/pfr/detail/core17.hpp:10:
1>z:\vc\x64\include\boost/pfr/detail/core17_generated.hpp(51): error :
cannot decompose this type; 'std::tuple_size<const my_struct>::value' is
not a valid integral constant expression
1>z:\vc\x64\include\boost/pfr/detail/core17_generated.hpp(1032): note: in
instantiation of function template specialization
'boost::pfr::detail::as_tuple_impl<const my_struct &>' requested here
1>z:\vc\x64\include\boost/pfr/precise/io.hpp(45): note: in instantiation
of function template specialization
'boost::pfr::detail::as_tuple<my_struct>' requested here
1>z:\vc\x64\include\boost/pfr/precise/ops.hpp(129): note: in instantiation
of function template specialization 'boost::pfr::write<char,
std::char_traits<char>, my_struct>' requested here
1>pfr.cpp(15): note: in instantiation of function template specialization
'boost::pfr::ops::operator<<<char, std::char_traits<char>, my_struct>'
requested here
1>Done building project "pfr.vcxproj" -- FAILED.

 degski

-- 
"*Ihre sogenannte Religion wirkt bloß wie ein Opiat reizend, betäubend,
Schmerzen aus Schwäche stillend.*" - Novalis 1798

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk