Opened 9 years ago

Closed 5 years ago

#9803 closed Bugs (invalid)

Boost Spirit debugging complains about missing << operator if rule attributes are defined in a different namespace

Reported by: barade.barade@… Owned by: Joel de Guzman
Milestone: To Be Determined Component: spirit
Version: Boost 1.54.0 Severity: Problem
Keywords: Cc:

Description

Assuming you have declared the attributes classes of your rules in a different namespace than your grammar with the rules. Now, when you use BOOST_SPIRIT_DEBUG_NODES compiler says that it misses operator<< for ostream and the attribute classes in the different namespace. Even if you define one in the namespace of the grammar it does not work. As the following link states it is not easy to define the operator in a proper way: https://stackoverflow.com/questions/5286720/how-to-define-streaming-operator-for-boostspiritqi-and-stdlist-container

Change History (2)

comment:1 by Nikita Kniazev <nok.raven@…>, 5 years ago

You must place your operator << in a namespace where your class is defined, otherwise ADL will not find it.

comment:2 by Joel de Guzman, 5 years ago

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.