W
wangjk
Hi,
I know there are many experienced C++ experts be here, i have a
puzzle :
(1) template <typename L, typename R, bool rL = false, bool rR =
flase > class A{.......};
(2) template <typename L, typename R> class
A<L,R,true,true>{......};
and there is a partial specification operator :
(3) template < >A<L,R>:perator()(int){......};
int main(){
......
return (new A<int,int,true,true>())->(5);
...
}
in the main function, in the return sentence ......->(5);, we called
the operator(),
I think it should call class (2)'s or it's base class's operator (),
but the result is that it called the operator in (3).
Who can tell me some? thanks!
I know there are many experienced C++ experts be here, i have a
puzzle :
(1) template <typename L, typename R, bool rL = false, bool rR =
flase > class A{.......};
(2) template <typename L, typename R> class
A<L,R,true,true>{......};
and there is a partial specification operator :
(3) template < >A<L,R>:perator()(int){......};
int main(){
......
return (new A<int,int,true,true>())->(5);
...
}
in the main function, in the return sentence ......->(5);, we called
the operator(),
I think it should call class (2)'s or it's base class's operator (),
but the result is that it called the operator in (3).
Who can tell me some? thanks!