From: Logan Capaldo Date: 2006-03-23T10:43:36+09:00 Subject: Re: Ruby for [...] programmers --Apple-Mail-5--585243300 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed On Mar 22, 2006, at 7:47 PM, Austin Ziegler wrote: > And I know C++ reasonably well and have been trying to exercise C++ to > what *should* work: > > struct ToString > { > ToString() > { > } > > template > std::string operator()(const T::values& v) > { > return T::to_str(v); > } > }; > > So far as I can tell, it doesn't work. Without something like that > (where, ideally, T could *either* be a real class and we're talking > about typedefs and static member functions inside the class or a > namespace), C++ can't claim that it does "duck typing", even at > compile time. > > -austin What compiler are you using? I'm pretty sure I've gotten g++ to do acrobatics like this in the past. --Apple-Mail-5--585243300--