Boost logo

Boost :

From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-02-05 14:50:33


John Torjo wrote:
> Steven Watanabe wrote:
>> namespaceboost_1_1logging_1_1formatter_1_1convert.html
>> "explain that you can extend the following - since they're
>> namespaces!!! so
>> that you can "inject" your own write function in the
>> convert_format::prepend/or
>> whatever namespace, and then it'll be automatically used!"
>> I'm almost certain that this is wrong. In order to be found by a template
> It's not - see

Ok. I'll be more concrete:

namespace X {

    int foo(int) { return(0); }

    template<class T>
    int bar(const T& t) {

class C {

namespace X {
    int foo(C) { return(0); }

int main() {

Como says:

>como -a test.cpp
Comeau C/C++ 4.3.9 (Apr 4 2007 16:51:45) for _MS_WINDOWS_x86_Beta
Copyright 1988-2007 Comeau Computing. All rights reserved.
MODE:strict warnings C++ noC++0x_extensions

"test.cpp", line 9: error: no instance of overloaded function "X::foo"
          the argument list
            argument types are: (const C)
          detected during instantiation of "int X::bar(const T &) [with
                    at line 21

1 error detected in the compilation of "test.cpp".

In Christ,
Steven Watanabe

Boost list run by bdawes at, gregod at, cpdaniel at, john at