SFINAE compiler troubles

前端 未结 5 843
一向
一向 2021-02-06 08:54

The following code of mine should detect whether T has begin and end methods:

template 
struct is_contai         


        
5条回答
  •  难免孤独
    2021-02-06 09:25

    Stephan T. Lavavej has this to say:

    Please note that it is technically forbidden to take the address of a Standard Library member function. (They can be overloaded, making &foo::bar ambiguous, and they can have additional default arguments, defeating attempts to disambiguate via static_cast.)

    So I guess I'm going to use the simpler version that only checks for the nested const_iterator type.

提交回复
热议问题