Template Class ID

Class Documentation

template<bool HAS_ID>
class ID

Helper calling “id” method in class if and only if it exists (SFINAE)

Helper class with “get” method that will execute a given objects “id” method & return result if “HAS_ID” template param is true and return string “unknown” otherwise. USAGE: ID< hasID<TOBJ>::value >().get(obj)

Public Functions

template<typename TOBJ>
inline auto get(TOBJ parent) -> decltype(parent.id())