
Peder Holt wrote:
On 1/3/06, Alexander Nasonov <alnsn@yandex.ru> wrote:
The patch below fixes this problem. It's built around comma operator:
struct void_ {}; template<class T> T& operator,(T const&, void_);
How will this work if someone implements their own operator,? template<class T> T& operator,(const my_type&,const T&);
if expr equals my_type, wouldn't this break typeof for my_type?
You're right. I should have added a special object to the left of expr: ( wrap_nonvoid_expr(), (expr), resolve_void() ).get() template<class T> struct wrapped_obj { T& get(); }; struct wrap_nonvoid_expr { template<class T> wrapped_obj<T> operator,(T const&); }; struct resolve_void { void get(); }; template<class T> wrapped_obj<T> operator,(wrapped_obj<T>, resolve_void); -- Alexander Nasonov