Boost logo

Boost :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2005-06-03 05:26:59

the program_options library fails one tests on EDG compilers (Intel, Como),
which a failure to deduce template arguments for a certain call. After reading
the standard for some time, I failed to understand the reason.

Below is the test program:

    char* cmdline3_[1] = {};
    template<class charT>
    void func(const charT* const argv[]) {}
    int main()
        // P is 'const charT* const argv[]'cmdline3_
        // A is 'char* cmdline3_[]'
        // According to
        // If P is not reference type
        // -If A is an array type, the pointer type produced
        // by the array-to-pointer standard convertion (4.2)
        // is used in place of A for type deduction.
        // So, A should become 'char**'
        // The following does not compile.
        char** p = cmdline3_;
        // This does compile, even though the argument type used for
        // type deduction should be the same as in example above.
Anybody can explain what's going on?


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