I do understand this is not an officially supported compiler, so I don't expect any changes to the library. Also while the IAR compiler 'claims' to support C++14, I have my doubts! https://www.iar.com/support/resources/articles/exploring-c11-and-c14/
My level of C++ is not good enough to dig deeper into the header file, so reporting how far I got.
If you have got this working, please comment below with suggested edits.
Expected Behavior
Compile without errors. Note: The compiler states__attribute__((unused)) is supported
Steps to Reproduce the Problem
Forced preprocessor to assume #define __GNUC__
Compile basic example
Actual Behavior
Error[Pe738]: a class-qualified name is required C:\Projects\C++\DI\boost\di.hpp 2341 (Highlights 'type')
Error[Pe065]: expected a ";" C:\Projects\C++\DI\boost\di.hpp 2341 (Highlights __BOOST_DI_UNUSED)
Change #define __BOOST_DI_UNUSED __attribute__((unused)) to #define __BOOST_DI_UNUSED
Actual Behavior
It compiles if the injector is not used. With injector usage, I get:
This line struct is_constructible : decltype(test_is_constructible<T, TArgs...>(0)) {}; - Compiler highlights (0) with this error:
Error[Pe871]: template instantiation resulted in unexpected function type of "boost::ext::di::v1_2_0::aux::true_type (int)" (the meaning of a name may have changed since the template declaration -- the type of the template is C:\Projects\C++\DI\boost\di.hpp 544
"boost::ext::di::v1_2_0::aux::true_type (int)")
detected during:
instantiation of "boost::ext::di::v1_2_0::aux::test_is_constructible" based on template arguments <boost::ext::di::v1_2_0::core::dependency<boost::ext::di::v1_2_0::scopes::instance, bool, bool &,
boost::ext::di::v1_2_0::no_name, void, boost::ext::di::v1_2_0::core::none>, boost::ext::di::v1_2_0::core::dependency<boost::ext::di::v1_2_0::scopes::instance, bool, bool &, boost::ext::di::v1_2_0::no_name, void,
boost::ext::di::v1_2_0::core::none> &&> at line 544
instantiation of class "boost::ext::di::v1_2_0::aux::is_constructible<T, TArgs...> [with T=boost::ext::di::v1_2_0::core::dependency<boost::ext::di::v1_2_0::scopes::instance, bool, bool &,
boost::ext::di::v1_2_0::no_name, void, boost::ext::di::v1_2_0::core::none>, TArgs=<boost::ext::di::v1_2_0::core::dependency<boost::ext::di::v1_2_0::scopes::instance, bool, bool &, boost::ext::di::v1_2_0::no_name, void,
boost::ext::di::v1_2_0::core::none> &&>]" at line 734
instantiation of class "boost::ext::di::v1_2_0::concepts::is_supported [with TDeps=<boost::ext::di::v1_2_0::core::dependency<boost::ext::di::v1_2_0::scopes::instance, bool, bool &,
boost::ext::di::v1_2_0::no_name, void, boost::ext::di::v1_2_0::core::none>>]" at line 834
instantiation of class "boost::ext::di::v1_2_0::concepts::boundable__ [with Ts=<boost::ext::di::v1_2_0::aux::type_list<boost::ext::di::v1_2_0::core::dependency<boost::ext::di::v1_2_0::scopes::instance, bool,
bool &, boost::ext::di::v1_2_0::no_name, void, boost::ext::di::v1_2_0::core::none>>>]" at line 109 of "C:\Projects\C++\DI\main.cpp"
Specifications
Version: 'Boost'.DI v1_2_0
Platform: IAR EW for ARM 8.50.5 (Win10 Cross compiler)
I do understand this is not an officially supported compiler, so I don't expect any changes to the library. Also while the IAR compiler 'claims' to support C++14, I have my doubts! https://www.iar.com/support/resources/articles/exploring-c11-and-c14/ My level of C++ is not good enough to dig deeper into the header file, so reporting how far I got. If you have got this working, please comment below with suggested edits.
Expected Behavior
Compile without errors. Note: The compiler states
__attribute__((unused))
is supportedSteps to Reproduce the Problem
#define __GNUC__
Actual Behavior
Error[Pe738]: a class-qualified name is required C:\Projects\C++\DI\boost\di.hpp 2341 (Highlights 'type') Error[Pe065]: expected a ";" C:\Projects\C++\DI\boost\di.hpp 2341 (Highlights __BOOST_DI_UNUSED)
struct arg_wrapper<T, TName, TIsRoot, TList<TCtor...>, TDependency, TDeps> {
using type __BOOST_DI_UNUSED = T;
...
};
Steps taken to fix
#define __BOOST_DI_UNUSED __attribute__((unused))
to#define __BOOST_DI_UNUSED
Actual Behavior
It compiles if the injector is not used. With injector usage, I get: This line [with TDeps=<boost::ext::di::v1_2_0::core::dependency<boost::ext::di::v1_2_0::scopes::instance, bool, bool &, [with Ts=<boost::ext::di::v1_2_0::aux::type_list<boost::ext::di::v1_2_0::core::dependency<boost::ext::di::v1_2_0::scopes::instance, bool,
struct is_constructible : decltype(test_is_constructible<T, TArgs...>(0)) {};
- Compiler highlights(0)
with this error: Error[Pe871]: template instantiation resulted in unexpected function type of "boost::ext::di::v1_2_0::aux::true_type (int)" (the meaning of a name may have changed since the template declaration -- the type of the template is C:\Projects\C++\DI\boost\di.hpp 544 "boost::ext::di::v1_2_0::aux::true_type (int)") detected during: instantiation of "boost::ext::di::v1_2_0::aux::test_is_constructible" based on template arguments <boost::ext::di::v1_2_0::core::dependency<boost::ext::di::v1_2_0::scopes::instance, bool, bool &,boost::ext::di::v1_2_0::no_name, void, boost::ext::di::v1_2_0::core::none>, boost::ext::di::v1_2_0::core::dependency<boost::ext::di::v1_2_0::scopes::instance, bool, bool &, boost::ext::di::v1_2_0::no_name, void,
boost::ext::di::v1_2_0::core::none> &&> at line 544 instantiation of class "boost::ext::di::v1_2_0::aux::is_constructible<T, TArgs...> [with T=boost::ext::di::v1_2_0::core::dependency<boost::ext::di::v1_2_0::scopes::instance, bool, bool &,
boost::ext::di::v1_2_0::no_name, void, boost::ext::di::v1_2_0::core::none>, TArgs=<boost::ext::di::v1_2_0::core::dependency<boost::ext::di::v1_2_0::scopes::instance, bool, bool &, boost::ext::di::v1_2_0::no_name, void,
boost::ext::di::v1_2_0::core::none> &&>]" at line 734 instantiation of class "boost::ext::di::v1_2_0::concepts::is_supported
boost::ext::di::v1_2_0::no_name, void, boost::ext::di::v1_2_0::core::none>>]" at line 834 instantiation of class "boost::ext::di::v1_2_0::concepts::boundable__
bool &, boost::ext::di::v1_2_0::no_name, void, boost::ext::di::v1_2_0::core::none>>>]" at line 109 of "C:\Projects\C++\DI\main.cpp"
Specifications
... If you wish to play, there is a free compiler limited to 32KB, enough to build all examples. https://www.iar.com/iar-embedded-workbench/#!?architecture=Arm