We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
template<>structTraits<Color>{staticstringname(intindex){switch(index){case0:return"red";case1:return"green";case2:return"orange";default:return"unknown";}}};// Specialization for Fruittemplate<>structTraits<Fruit>{staticstringname(intindex){switch(index){case0:return"apple";case1:return"orange";case2:return"pear";default:return"unknown";}}};
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
C++ Class Template Specialization
You are viewing a single comment's thread. Return to all comments →
// We can represent enums like numbers