Closed flexferrum closed 6 years ago
UPD: If include 'expected.hpp' before 'variant.hpp' and set 'nonstd_lite_HAVE_IN_PLACE_TYPES' macro manually, errors will become more serous:
In file included from /projects/flexferrum-Jinja2Cpp/src/internal_value.h:9:0,
from /projects/flexferrum-Jinja2Cpp/src/expression_evaluator.h:4,
from /projects/flexferrum-Jinja2Cpp/src/filters.h:4,
from /projects/flexferrum-Jinja2Cpp/src/filters.cpp:1:
/projects/flexferrum-Jinja2Cpp/thirdparty/nonstd/variant-light/include/nonstd/variant.hpp:1035:53: error: expected ‘)’ before ‘,’ token
explicit variant( nonstd_lite_in_place_type_t(T), Args&&... args)
^
/projects/flexferrum-Jinja2Cpp/thirdparty/nonstd/variant-light/include/nonstd/variant.hpp:1043:53: error: expected ‘)’ before ‘,’ token
explicit variant( nonstd_lite_in_place_type_t(T), std::initializer_list<U> il, Args&&... args )
^
/projects/flexferrum-Jinja2Cpp/thirdparty/nonstd/variant-light/include/nonstd/variant.hpp:1051:52: error: ‘I’ is not a type
explicit variant( nonstd_lite_in_place_index_t(I), Args&&... args )
^
/projects/flexferrum-Jinja2Cpp/thirdparty/nonstd/variant-light/include/nonstd/variant.hpp:1051:54: error: expected ‘)’ before ‘,’ token
explicit variant( nonstd_lite_in_place_index_t(I), Args&&... args )
^
/projects/flexferrum-Jinja2Cpp/thirdparty/nonstd/variant-light/include/nonstd/variant.hpp:1059:52: error: ‘I’ is not a type
explicit variant( nonstd_lite_in_place_index_t(I), std::initializer_list<U> il, Args&&... args )
I'm considering the following way of fix: move common types, macros etc. to separate repo and then combine the 'production' headers via Jinja2 - just include one Jinja2 template into another. It allows to keep the common code consistent.
This is a 'duplicate' of issue 14 at expected-lite .
I'd like to keep the shared "in_place
infrastructure" as simple as it is now and refrain from file generation for any-lite, optional-lite and expected-lite.
I've had a go at using optional-lite's (etc.) in_place
setup before, but was not immediately successful (can't remember why). Also I can't remember from the top of my head why expected-lite's in_place
is as it is. Further, I have a longstanding action to update expected-lite (old repo) (new repo) to the latest proposal, a moving target.
References:
in_place
at cppreferenceDone per nonstd-lite issue 17.
I'll try to check it out tonight. Thanks!
It works!
Nice! Thanks for letting me know.
I included both nonstd/expected.hpp and nonstd/variant.hpp in one file and got the following error: