From: Steven Watanabe (steven_at_[hidden])
Date: 2007-08-11 12:52:23


AMDG

Andreas Huber <ahd6974-spamboostorgtrap <at> yahoo.com> writes:

> See above, your finding of flaws with these warnings is not exactly common.

It's happened to me too. I was accidentally passing a reference
type to alignment_of. I knew there was a problem in my code
but the warning helped my find it immediately. If you really
need to suppress this warning for users you can write

template<class T>
class C {
public:
    C(const C& c) {
        BOOST_STATIC_ASSERT((!boost::is_same<T, T>::value));
    }
    C& operator=(const C& c) {
        BOOST_STATIC_ASSERT((!boost::is_same<T, T>::value));
    }
};

In Christ,
Steven Watanabe