Detecting if an element is found inside a container
Note that for functions the compiler will detect the template types based on the parameters.
So you can simply write:

bool test = is_contained(container.begin(), container.end(), anything);


I don't particularly like the use of decltype in your function. I would simply make it another template parameter.

template &lt;typename Iterator, typename Value&gt;
bool is_contained(Iterator begin, Iterator end, Value const&amp; object);


Because of the compiler deducing the names you can use any type. Also this is more flexable as it allows you to use any type that is comparable to the type inside the container (rather than only allowing values that are the same type (or trivial convertible)).