Dear list,
I have a problem with the implicit conversion to bool in the shared_ptr
class.
I want to use operator overloading for an easy to use interface. I have
2 Instances of a class with a common
Interface and I want to define an operator-class (OpAnd of type K) which
can handle the operator.
By compiling this little test below, I got:
g++ -I/home/steckmann/proj/libs/boost -O0 -g3 -Wall -c
-fmessage-length=0 -MMD -MP -MF"test.d" -MT"test.d" -o "test.o"
"../test.cpp"
../test.cpp: In function 'int main()':
../test.cpp:49: error: ambiguous overload for 'operator&&' in 'a && b'
../test.cpp:49: note: candidates are: operator&&(bool, bool) <built-in>
../test.cpp:40: note: boost::shared_ptr<K>
operator&&(boost::shared_ptr<K>, boost::shared_ptr<K>)
This is quite clear to me, but how can I avoid this without touching the
shared_ptr?
Thanks for any comments,
Sven
#include