mpl::vector<void> compiler bugs?

The attached file gets following output: <-------------- cut here --------------- como -c --timing --long_long --display_error_number --diag_suppress 76 -I/home/evansl/prog_dev/boost-root.ln/boost_dev -I/home/evansl/prog_dev/boost-root.ln -o vec_void_const_bug.o vec_void_const_bug.cpp Comeau C/C++ 4.3.3 (Jan 30 2004 15:40:54) for LINUX_INTEL_ELF Copyright 1988-2004 Comeau Computing. All rights reserved. MODE:non-strict warnings C++ Front end time 0.76 (CPU) 1.00 (elapsed) Back end time 0.02 (CPU) 0.00 (elapsed) Total compilation time 0.78 (CPU) 1.00 (elapsed) como -o vec_void_const_bug.exe vec_void_const_bug.o running vec_void_const_bug ./vec_void_const_bug.exe mt_var: member_target(vector<void> const&) mt_con: mt_cast: member_target(vector<void> const&) end:
------------- cut here --------------------- When it should get the same output after mt_con: as it does for mt_var: and mt_cast:.
I get similar problems with g++3.4 and intel 8.0. Are all these compilers wrong or am I missing something? TIA.

On 03/22/2004 03:34 PM, Larry Evans wrote:
The attached file gets following output: For some reason the attachment didn't attach :( Here's the code:
#include <boost/mpl/vector.hpp> #include <iostream> struct member_target { member_target ( boost::mpl::vector<void> const& ) { std::cout<<"member_target(vector<void> const&)\n"; } member_target ( void ) { std::cout<<"member_target(void)\n"; } member_target ( member_target const& ) { std::cout<<"member_target(member_target const&)\n"; } }; int main(void) { typedef boost::mpl::vector<void> void_typelist; void_typelist a_vtl; std::cout<<"mt_var:\n"; member_target mtvar( a_vtl ); std::cout<<"mt_con:\n"; member_target mtcon( void_typelist() ); std::cout<<"mt_cast:\n"; member_target mt_cast( static_cast<void_typelist const&>(void_typelist()) ); std::cout<<"end:\n"; return 0; }

On 03/22/2004 03:45 PM, Larry Evans wrote:
On 03/22/2004 03:34 PM, Larry Evans wrote: [snip] Replaced: member_target mtcon( void_typelist() ); with: member_target mtcon=void_typelist(); and things work OK. Apparently the compiler thought mtcon was a function.
Sorry for noise.
participants (1)
-
Larry Evans