source code size metric: Python and modern C++
David Abrahams
dave at boost-consulting.com
Tue Dec 3 14:59:55 EST 2002
Brian Quinlan <brian at sweetapp.com> writes:
> David Abrahams wrote:
>> The type-safe version could easily look like this instead:
>>
>> ServerProxy
> s("http://www.sweetapp.com/cgi-bin/xmlrpc-test/rpc1.py");
>> int result = s.call_method<int>("add", 2, 3);
>>
>> That's not too bad.
>
> You can only do this in the special case where all the arguments and the
> result are of the same type.
Not true.
struct ServerProxy
{
...
// use a family of these with different arities
template <class R, class A1, class A2>
R call_method(char const* name, A1 a1, A2 a2);
...
};
> Do I really have to pick another example to demonstrate this?
It's up to you, bubba.
--
David Abrahams
dave at boost-consulting.com * http://www.boost-consulting.com
Boost support, enhancements, training, and commercial distribution
More information about the Python-list
mailing list