Boost logo

Boost Users :

Subject: [Boost-users] can't take const ref to tribool's indeterminate
From: Phil Nash (phil.nash.lists_at_[hidden])
Date: 2011-04-19 03:27:14

Hi all,

The following does not compile (GCC 4.2):

    #include <boost/logic/tribool.hpp>

    template<typename T>
    void byRef( const T& v )

    // ...

      byRef( boost::indeterminate );

I realise that indeterminate is actually a function. If I write my
own, equivalent, function I can substitute it here and it compiles,
however. I can't see what is stopping it from working in
indeterminate's case - but I suspect it is to do with some of the
operator overloading going on. I couldn't pin it down, though.

I can take it by value, of course.

What am I missing?

Before you ask - yes this is boiled down code. In my real situation I
have generic code that doesn't even know about tribool, so I can't
special-case it. And I'd rather get to the bottom of why it doesn't
work for me - even if the end result is "you can't do that".

Thanks and regards,


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at