
27 Aug
2016
27 Aug
'16
6:32 p.m.
Consider: using any_t=any< boost::mpl::vector< copy_constructible<>, incrementable<> > >; struct foo{}; int main() { std::cout<<std::is_constructible<any_t,foo>::value<<"\n"; } This program outputs 1 as the ctor of boost::type_erasure::any<Concept> if not restricted to Concept-compliant args, but of course we can't use foo to construct any_t: any_t x{foo{}}; // compile error as foo is not incrementable Is there a (publicly available) way to determine if an argument of type U can be used to construct an any<Concept,T>? I'd like to have this for doing SFINAE in my any-using code. Thank you, Joaquín M López Muñoz