The World’s Largest Online Community for Developers
Newest 'enable-if' Questions - LavOzs.Com
Questions tagged [enable-if]
`std::enable_if` is a C++ metafunction template with parameters `bool B`, `class T = void`,
defined in the Standard C++ header `type_traits`. If `B` is true then the instantiating
class defines a public member type `type` equal to `T`; otherwise it does not.
I want to use std::enable_if for MyClass in order to accept only (uint32_t | uint64_t) and at the same time if the user did not provide any type; a default one is picked according to bellow condition....
I am using gcc 4.8.4 with -std=c++11
Originally I have this simplified minimum code below ( since the definition of function is quite complex, I implemented template class definition outside of class ...
I managed to overload insertion operator for std::ostream based on rank of object.
I would like to extend below example.
When A_new.h is included, it includes A.h... in this case I am checking rank ...
I am trying to introduce the overloading mechanism based on rank of the object.
I managed to implement simple example based on other post and it works for simple types: