mercredi 26 octobre 2016

How to specialize a type based on whether a template parameter has an alias

I want to be able to specialize a type based on whether a container has a specified typedef for example

class SomethingElse {};
class Something {
    using Type = int;
};

static constexpr bool value = ChooseIfType<Something>::value;

Is there a way for ChooseIfType to return false when the type does not have a typedef?

I feel like there is an easy way to do this but I cannot figure it out.

Thanks!

Aucun commentaire:

Enregistrer un commentaire