don't add -std=c++11 in WIN32 case
initialize a member with value 0 by using T's constructor, not a double
we need algorithm for std::min on windows
cast size_t to long to silence warning