ambiguous function call
- From: "Mycroft Holmes" <m.holmes@xxxxxxxxx>
- Date: Fri, 30 Mar 2007 10:33:56 +0200
Hi,
the following code works in gcc, but not in VC8.0(SP1). Empirical evidence
suggests that visual studio is right (both Comeau and the Intel compiler
reject it), but I can't understand why the code should be ambiguous: x is a
reference to array, so an exact match should be preferred to
decay-into-pointer.
Can somebody help me understand?
Thanks,
MH
template <typename T>
void do_it_impl(const T* const x)
{
}
template <typename T, int K>
void do_it_impl(T (&x)[K])
{
}
template <typename T>
void do_it(T& x)
{
do_it_impl(x);
}
int main()
{
double a[30];
do_it(a);
}
.
- Follow-Ups:
- Re: ambiguous function call
- From: Alex Blekhman
- Re: ambiguous function call
- Prev by Date: Re: _itoa: The POSIX name for this item is deprecated
- Next by Date: Re: stl performance question
- Previous by thread: StretchBlt() and memory usage
- Next by thread: Re: ambiguous function call
- Index(es):
Relevant Pages
|
Loading