Opened 12 years ago

Closed 12 years ago

#4495 closed Bugs (invalid)

Including dynamic_bitset while using BGL's boost::dynamic_properties forces operator>> into std namespace

Reported by: Thomas Krennwallner <tkren@…> Owned by: Gennaro Prota
Milestone: Boost 1.44.0 Component: dynamic_bitset
Version: Boost 1.43.0 Severity: Problem
Keywords: Cc: ghionna@…, dao@…

Description

Including dynamic_bitset.hpp (without using it) breaks previously working BGL code, which uses boost::dynamic_properties. We get the following error:

/opt/local/include/boost/lexical_cast.hpp:785: error: no match for 'operator>>' in 'stream >> output'

Wrapping my operator>> into namespace std fixes the compiler error.

I've created a rather "minimal" example which should confirm this (simply run g++ XXX.cpp):

  • xxx.cpp: this is the version without dynamic_bitset and compiles
  • yyy.cpp: a variant of xxx.cpp which includes dynamic_bitset; gives above compiler error
  • zzz.cpp: this is a variant of yyy.cpp which compiles again

The problem can be reproduced in Boost 1.43.0 and in Boost trunk.

Attachments (3)

xxx.cpp (756 bytes ) - added by Thomas Krennwallner <tkren@…> 12 years ago.
Working example without dynamic_bitset
yyy.cpp (6.4 KB ) - added by Thomas Krennwallner <tkren@…> 12 years ago.
Nonworking example with dynamic_bitset
zzz.cpp (1.0 KB ) - added by Thomas Krennwallner <tkren@…> 12 years ago.
Workaround

Download all attachments as: .zip

Change History (4)

by Thomas Krennwallner <tkren@…>, 12 years ago

Attachment: xxx.cpp added

Working example without dynamic_bitset

by Thomas Krennwallner <tkren@…>, 12 years ago

Attachment: yyy.cpp added

Nonworking example with dynamic_bitset

by Thomas Krennwallner <tkren@…>, 12 years ago

Attachment: zzz.cpp added

Workaround

comment:1 by Steven Watanabe, 12 years ago

Resolution: invalid
Status: newclosed

yyy.cpp is incorrect. operator>> cannot be found by Argument Dependent Lookup. xxx.cpp only works because gcc doesn't implement two-phase name lookup perfectly.

Note: See TracTickets for help on using tickets.