Added template function select_if() in variant.h; Unit-tested.

this function should be static, not a member function.