How to pass template argument to std::function?
I have some template functions to aggregate a vector into a string in my C++ project. And I need to pass aggregation algorithm from one function to another using std::function.
Better Way to Infer Zero for Arbitrary Type Specializing `std::numeric_limits`?
I haven arbitrary type T
that specializes std::numeric_limits
. Typically, for standard types that have the concept of a zero-element, std::numeric_limits<T>::zero()
would make sense, but as we know, std::numeric_limits
doesn’t provide such a member function.