The call operators of esulting function objects are strictly typed (in
other words, non-templatized) with the types from a Sequence.

The type of the target function is allowed to be const qualified or a reference.
Const qualification is preserved and propagated appropriately (in other
words, only const versions of operator() can be used
if the target function object is const - or, in case the target function
object is held by value, the adapter is const).

For Microsoft Visual C++ 7.1 (Visual Studio 2003)
the detection of the Function Object's const qualification easily causes
an internal error. Therefore the adapter is always treated as if it was
const.

If the type sequence passed to this template contains
non-reference elements, the element is copied only once - the call operator's
signature is optimized automatically to avoid by-value parameters.

structadd_assign// applies operator+=
{typedefvoidresult_type;// for simplicity
template<typenameT>voidoperator()(T&lhs,Tconst&rhs)const{lhs+=rhs;}};template<classTie>classfused_parallel_adder{Tietie_dest;public:explicitfused_parallel_adder(Tieconst&dest):tie_dest(dest){}typedefvoidresult_type;template<classSeq>voidoperator()(Seqconst&s)const{for_each(zip(tie_dest,s),fused<add_assign>());}};// accepts a tie and creates a typed function object from it
structfused_parallel_adder_maker{template<typenameSig>structresult;template<classSelf,classSeq>structresult<Self(Seq)>{typedeftypenameremove_reference<Seq>::typeseq;typedefunfused_typed<fused_parallel_adder<seq>,typenamempl::transform<seq,remove_reference<_>>::type>type;};template<classSeq>typenameresult<void(Seq)>::typeoperator()(Seqconst&tie){returntypenameresult<void(Seq)>::type(fused_parallel_adder<Seq>(tie));}};unfused<fused_parallel_adder_maker>parallel_add;voidtry_it(){inta=2;charb='X';// the second call is strictly typed with the types deduced from the
// first call
parallel_add(a,b)(3,2);parallel_add(a,b)(3);parallel_add(a,b)();assert(a==8&&b=='Z');}