Hi, I'm getting a compiler error with MSVC .NET 2003 in release mode. Compiling the following code gives: "error C2676: binary '&&' : 'const ASP' does not define this operator or a conversion to a type acceptable to the predefined operator" If I compile in debug mode, or if I remove the "const" on the shared_ptr arguments, it complies without complaint. ==== #include <boost/shared_ptr.hpp> class A; class B; class C; typedef boost::shared_ptr<A> ASP; typedef boost::shared_ptr<B> BSP; typedef boost::shared_ptr<C> CSP; void test(const ASP& a, const BSP& b, const CSP& c) { bool rc = false; if (a && b && c) rc = true; } ====
Tim Murison wrote:
Hi,
I'm getting a compiler error with MSVC .NET 2003 in release mode. Compiling the following code gives: "error C2676: binary '&&' : 'const ASP' does not define this operator or a conversion to a type acceptable to the predefined operator"
If I compile in debug mode, or if I remove the "const" on the shared_ptr arguments, it complies without complaint.
Interestingly, I'm getting the same error in debug builds and non-const arguments as well, even on if( a && b ). I'll try to find a workaround. FWIW, VC8 compiles the code.
participants (2)
-
Peter Dimov
-
Tim Murison