#include <iostream>
#include <vector>
#include <type_traits>
using namespace std;


template<typename In>
auto foo(In input, std::true_type) {
	return input[0];
}
template<typename In>
auto foo(In input, std::false_type) {
	return input;
}
template<bool IsVector, typename In>
auto foo(In input) {
	using tag = typename conditional<IsVector, true_type, false_type>::type;
	return foo(input, tag{});
}


int main() {
	cout << foo<true>(vector<double>{{1, 2 , 3}}) << endl;
	cout << foo<false>(4.5) << endl;
	return 0;
}