bdmenums.h
proper use of std::min