Blaze 3.9
Loading...
Searching...
No Matches
blaze::IsConvertible< From, To > Struct Template Reference

Compile time pointer relationship constraint. More...

#include <IsConvertible.h>

Inherits blaze::IntegralConstant< bool, B >.

Detailed Description

template<typename From, typename To>
struct blaze::IsConvertible< From, To >

Compile time pointer relationship constraint.

This type traits tests whether the first given template argument can be converted to the second template argument via copy construction. If the first argument can be converted to the second argument, the value member constnt is set to true, the nested type definition type is TrueType, and the class derives from TrueType. Otherwise value is set to false, type is FalseType, and the class derives from FalseType.

struct A {};
struct B : public A {};
struct C {};
struct D {
D( const C& c ) {}
};
blaze::IsConvertible<int,unsigned int>::value // Evaluates to 'true'
blaze::IsConvertible<float,const double>::value // Evaluates to 'true'
blaze::IsConvertible<B,A>::Type // Results in TrueType
blaze::IsConvertible<B*,A*>::Type // Results in TrueType
blaze::IsConvertible<C,D> // Is derived from TrueType
blaze::IsConvertible<char*,std::string> // Is derived from TrueType
blaze::IsConvertible<std::string,char*>::value // Evaluates to 'false'
blaze::IsConvertible<A,B>::Type // Results in FalseType
blaze::IsConvertible<A*,B*> // Is derived from FalseType

The documentation for this struct was generated from the following file: