Boost logo

Boost Users :

Subject: [Boost-users] template trick
From: gast128 (gast128_at_[hidden])
Date: 2014-02-18 07:42:13


I recently watched Stephen Lavavej's excellent channel9 video 'Core C++, 2
of n' in which he described a nice trick to stop template argument deduction:

template <typename T>
void (T t1, typename std::identity<T>::type t2)
{
}

Browsing the internet for a similar problem, I recently discovered that
Peter Dimov already described this trick in 2002 in 'Template function type
inference with references' comp.lang.c++.moderated.

Boost is more for the libraries, but could it also reserve some space for
documenting these template tricks?


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net