MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / checked_negate

Function checked_negate

Source/Utils/cxxopts.hpp:850–857  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

848
849 template <typename R, typename T>
850 void
851 checked_negate(R& r, T&& t, const std::string&, std::true_type)
852 {
853 // if we got to here, then `t` is a positive number that fits into
854 // `R`. So to avoid MSVC C4146, we first cast it to `R`.
855 // See https://github.com/jarro2783/cxxopts/issues/62 for more details.
856 r = static_cast<R>(-static_cast<R>(t-1)-1);
857 }
858
859 template <typename R, typename T>
860 void

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected