[aspectc-user] Problem with template function declaration

Matthias Urban matthias.urban at pure-systems.com
Mon Jul 5 00:45:39 CEST 2010


Hi,

thanks for the bug report. There was an error creating the correct
conversion sequence for the implicit 'this' parameter of class member
functions. This is fixed now.

Best regards,
Matthias


> i have an problem with the following piece of code:
> 
> ================================================================================
> template<typename T> T stoc(T value);
> 
> template<typename T>
>     T stoc(T value) {
>     return value;
> }
> 
> int main () {
>     int bla=0xa;
>     return stoc(bla);
> }
> ================================================================================
> 
> ==Compiler error================================================================
> stoc.cpp:10: error: call to function `stoc (int)' is ambiguous
> stoc.cpp:4: candidates are: T stoc(T) [with T = int]
> stoc.cpp:1:                 T stoc(T) [with T = int]
> ================================================================================
> 
> It looks like the compiler makes no difference between the declaration
> and the implementation of template function.
> Commenting out the declaration fixes the problem :).



More information about the aspectc-user mailing list