c++ - Static Assert that a type A can be constructed from type B -
I am trying to make a constant assertion for two types of A and B; Class A must be a public constructor of signature A (B & B) or A (Const B & B).
Let me tell you some type of is_constructable_from & lt; A, B & gt; : Value
which evaluates for true
if any public A (B & B) or A (Const B & B) or A (BB) exists.
I think this is somewhat different from promoting.
How do I get it?
Am I not left anything that will boost types of symptoms or concepts in the Czech Library?
Now I need to do a constant check that the expression aa (b)
is a valid one, as the previous concept recommended by the show is less restrictive than both The solution to the cases is welcome. I have permission to use Boost.
Constructors are not members - they have no address you can take, so SFINAE It is impossible to test their presence in a direct way with .
While it is not at all with C ++ 11 you can meet with , and with C ++ 03 you can get your rollout Must do:
template & lt; Class A, class B = null & gt; Structure is_constructible; Template & lt; Class A, Class B & gt; Structure is_constructible {template & lt; Class U & gt; Stable u decadence (); Template & lt; Std :: size_t N & gt; Structure dummy; Template & lt; Square U & gt; Static Four Trials (Dummy & Lt; Saiff (U (Develwell & lt; B & gt; ())); *); Template & lt; Square U & gt; Stable long exam (...); Static Controlled Bull Value = Sizef (Test; & lt; a & gt; (0)) == Size (Four); }; The following is an interesting attempt, but in my understanding, it does not work well in the compiler:
Comments
Post a Comment