您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

26 行
789 B

  1. #pragma once
  2. namespace cppcore
  3. {
  4. /**
  5. * @brief Convert one type to another type.
  6. *
  7. * This method will try to convert the given value to the given type.
  8. * If a convertion between the two types is unknown, a compiler error is raised.
  9. * If the value to convert does not fullfill the conversion requirements (like range checks)
  10. * the program will panic (call to std::abort) or throw an convert_exception (if configured).
  11. *
  12. * @tparam T_to Type to convert to.
  13. * @tparam T_from Type to convert from.
  14. *
  15. * @param[in] p_value Value to convert.
  16. * @return Converted value.
  17. */
  18. template<typename T_to, typename T_from>
  19. constexpr T_to convert_cast(T_from p_value);
  20. }
  21. #include "convert_cast.inl"