On 1 February 2012 20:33, Olaf Meeuwissen
I noticed this when I played around with wrapping qi::parse() in a parse() function that does some things before and after qi::parse().
My code had been calling qi::parse(), with the `qi::` namespace prefix, everywhere so I removed from a few calls and compiled before adding a parse() declaration. Lo and behold, compilation unexpectedly succeeded. I've reduced the behaviour in a minimalistic sample program (attached).
I expect their to be *no* parse() function within the scope of main(). Can anyone clarify why the compiler has no trouble finding one and which one it finds?
Adding a global scope operator to the call, i.e. saying ::parse(), does result in the expected compile error.
Using Boost 1.46.1, gcc 4.6.2 on Debian wheezy.
Thanks in advance, -- Olaf Meeuwissen, LPIC-2 FLOSS Engineer -- AVASYS CORPORATION FSF Associate Member #1962 Help support software freedom http://www.fsf.org/jf?referrer=1962
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
The compiler uses Argument Dependent Lookup (ADL) to determine which function to call. One of the parameters is qi::rule, so the compiler looks in that namespace for a matching parse function.