Maybe I'm not all there today, but I'm wondering how to get this to work.
I'd like to partially specialize range_mutable_iterator and range_const_iterator from the boost library but only for specific types that I'd rather avoid mentioning explicitly, instead only letting the partial specialization be chosen if the enable_if test criteria...
I am using PC-Lint (great tool for static code analysis - see http://www.gimpel.com/)
For the following chunk of code:
class ASD {
protected:
template<int N>
void foo();
};
template<>
inline void ASD::foo<1>() {}
template<int N>
inline void ASD::foo() {}
PC-lint gives me a warning:
inline void ASD::foo<1>() {}
m...
This question got me thinking. Sometimes it's useful to grab an actual argument from a class template specialization, if it fails to define a public typedef of the argument. In C++03 it's a sign of either bad template design, or contrary design intent, and not particularly common. But variadic templates make typedef coverage impossible, ...
I'm using an C++ "event" class that allowed one or two arguments in the to be called delegates.
Lately I've added support for delegates that don't require arguments, however when I specialze the class to use no template arguments I'm still required to add <> afther the class definition.
Example usage with one/two arguments:
class Exam...
I am working on a template class Array, which accepts another template TRAITS as a parameter.
template <typename BASE, typename STRUCT>
class Traits {
public:
typedef BASE BaseType;
typedef STRUCT Struct;
// .. More here
};
template <class TRAITS>
class Array {
public:
typedef TRAI...