add C++14 constexpr sample algorithm