-
Notifications
You must be signed in to change notification settings - Fork 166
Closed
Labels
Description
The example:
#include <iostream>
#include <string>
#include "boost/pfr/precise.hpp"
struct some_person {
std::string name;
unsigned birth_year;
};
int main() {
some_person val{"Edgar Allan Poe", 1809};
std::cout << boost::pfr::get<0>(val) // No macro!
<< " was born in " << boost::pfr::get<1>(val); // Works with any aggregate initializables!
}Does not compile:
1>a:\cpp\reftest\reftest\ext\include\boost\pfr\detail\fields_count.hpp(209): error C2338: ====================> Boost.PFR: Types with user specified constructors (non-aggregate initializable types) are not supported.
1>a:\cpp\reftest\reftest\ext\include\boost\pfr\detail\core17_generated.hpp(1036): note: see reference to function template instantiation 'size_t boost::pfr::detail::fields_count<T>(void) noexcept' being compiled
1> with
1> [
1> T=some_person
1> ]
1>a:\cpp\reftest\reftest\ext\include\boost\pfr\precise\core.hpp(50): note: see reference to function template instantiation 'auto boost::pfr::detail::tie_as_tuple<T>(T &) noexcept' being compiled
1> with
1> [
1> T=some_person
1> ]
1>a:\cpp\reftest\reftest\src\main.cpp(62): note: see reference to function template instantiation 'decltype(auto) boost::pfr::get<0,some_person>(T &) noexcept' being compiled
1> with
1> [
1> T=some_person
1> ]
1>a:\cpp\reftest\reftest\ext\include\boost\pfr\detail\fields_count.hpp(214): error C2338: ====================> Boost.PFR: If there's no other failed static asserts then something went wrong. Please report this issue to the github along with the structure you're reflecting.
1>a:\cpp\reftest\reftest\ext\include\boost\pfr\detail\sequence_tuple.hpp(114): error C2338: ====================> Boost.PFR: Tuple index out of bounds
1>a:\cpp\reftest\reftest\ext\include\boost\pfr\precise\core.hpp(50): note: see reference to function template instantiation 'decltype(auto) boost::pfr::detail::sequence_tuple::get<0,>(boost::pfr::detail::sequence_tuple::tuple<> &&) noexcept' being compiled
1>a:\cpp\reftest\reftest\ext\include\boost\pfr\detail\sequence_tuple.hpp(115): error C2672: 'get_impl': no matching overloaded function found
1>a:\cpp\reftest\reftest\ext\include\boost\pfr\detail\sequence_tuple.hpp(113): error C2784: 'T &boost::pfr::detail::sequence_tuple::get_impl(boost::pfr::detail::sequence_tuple::base_from_member<N,T> &) noexcept': could not deduce template argument for 'boost::pfr::detail::sequence_tuple::base_from_member<0,T> &' from 'boost::pfr::detail::sequence_tuple::tuple<>'
1>a:\cpp\reftest\reftest\ext\include\boost\pfr\detail\sequence_tuple.hpp(51): note: see declaration of 'boost::pfr::detail::sequence_tuple::get_impl'
1>a:\cpp\reftest\reftest\src\main.cpp(62): error C2679: binary '<<': no operator found which takes a right-hand operand of type 'void' (or there is no acceptable conversion)
Compiler:
/JMC /permissive- /MP /GS /W3 /Zc:wchar_t /I"A:\cpp\reftest\reftest\ext\include\" /I"A:\cpp\reftest\\include\" /I"C:\Program Files (x86)\Visual Leak Detector\include" /ZI /Gm- /Od /sdl /Fd"x64\Debug\vc141.pdb" /Zc:inline /fp:precise /D "_MBCS" /errorReport:prompt /WX- /Zc:forScope /RTC1 /Gd /MDd /std:c++17 /FC /Fa"x64\Debug\" /EHsc /nologo /Fo"x64\Debug\" /Fp"x64\Debug\reftest.pch" /diagnostics:classic