¡@

Home 

c++ Programming Glossary: has_foo

Specializing C++ template based on presence/absense of a class member?

http://stackoverflow.com/questions/10354774/specializing-c-template-based-on-presence-absense-of-a-class-member

struct A typedef int foo struct B template class T bool has_foo struct C I want to specialize C so that C A gets one specialization.. it's short. template class T constexpr typename T foo has_foo T return typename T foo 1 constexpr bool has_foo ... return.. T foo has_foo T return typename T foo 1 constexpr bool has_foo ... return false template class T bool has_foo bool has_foo..

SFINAE to check for inherited member functions

http://stackoverflow.com/questions/1966362/sfinae-to-check-for-inherited-member-functions

iostream template typename T typename Sig struct has_foo template typename U U struct type_check template typename V.. foo struct B A int main using namespace std cout boolalpha has_foo A void A value endl true cout boolalpha has_foo B void B value.. boolalpha has_foo A void A value endl true cout boolalpha has_foo B void B value endl false So is there a way to test for inherited..