124 (decltype(SP1)::has<svc::ProviderA>(),
"We don't believe to have ProviderA!!");
126 static_assert(std::is_same<decltype(myA),
svc::ProviderA const*>(),
127 "Failed to get the element of type A");
128 BOOST_TEST(myA == &providerA);
132 (decltype(SP1)::has<svc::ProviderB>(),
"We don't believe to have ProviderB!!");
134 static_assert(std::is_same<decltype(myB),
svc::ProviderB const*>(),
135 "Failed to get the element of type B");
136 BOOST_TEST(myB == &providerB);
140 (decltype(SP1)::has<svc::ProviderC>(),
"We don't believe to have ProviderC!!");
142 static_assert(std::is_same<decltype(myC),
svc::ProviderC const*>(),
143 "Failed to get the element of type C");
144 BOOST_TEST(myC == &providerC);
149 SP1.set(&providerA2);
151 BOOST_TEST(myA == &providerA2);
155 #if PROVIDERPACK_TEST_SKIP_COMPILATION_ERRORS 156 BOOST_TEST_MESSAGE(
" (test to get a non-existing provider type skipped)");
159 #endif // !PROVIDERPACK_TEST_SKIP_COMPILATION_ERRORS 163 (!decltype(SP1)::has<svc::ProviderD>(),
"We believe to have ProviderD!!");
177 #if PROVIDERPACK_TEST_SKIP_COMPILATION_ERRORS 179 (
" (test to create a pack with many providers with same type skipped)");
183 #endif // !PROVIDERPACK_TEST_SKIP_COMPILATION_ERRORS A service provider class.
Provider const * get() const
Returns the provider with the specified type.
A service provider class.
ProviderPack< Providers... > makeProviderPack(Providers const *...providers)
Function to create a ProviderPack from the function arguments.
A service provider class.
A service provider class.
Container for a list of pointers to providers.