This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "gmock/gmock.h" | |
| #include <iostream> | |
| #include <sstream> | |
| #include <type_traits> | |
| #include <limits> | |
| /// Given a value, return the value directly before it (without using minus) | |
| template <typename T, T goal_value, T current_value = 0> | |
| struct value_before { static constexpr const T value = (current_value + 1 == goal_value) ? current_value : value_before<T, goal_value, current_value + 1>::value; }; |