template-argument inference and binary_function

– function templates are often specialized without explicit template-argument, because compiler can infer from function arguments.
– However, class templates always need explicit template-argument.

Despite the name, unary_function (and binary_function) is an empty class template (actually struct template)
* without operator() declared ( — so You must subclass and furnish it in order to use it )
* that needs explicit type arg.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s