lundi 4 novembre 2019

What is std::false_type or std::true_type?

I saw its usage as below

template <typename T>
struct DependentFalse : std::false_type
{};

Then, it is used here

template <typename T>
class RadarSensor
{
    static_assert(DependentFalse<T>::value, "RadarSensor must be created using Identifier template");
};

I do not have idea what is it used for?

What is DependentFalse structure?

Aucun commentaire:

Enregistrer un commentaire