namespace mrpt::containers::internal
Overview
namespace internal { // enums enum tag_as_const_proxy_t; enum tag_as_proxy_t; // structs template <typename T> struct CopyCloner; template <typename T> struct CopyStatic; struct UnspecializedBool; struct dynamic_grid_txt_saver; // classes template <typename T, typename Copier> class generic_copier_ptr; // global functions template <typename T> const std::shared_ptr<T>& element_as_shared_ptr(const std::shared_ptr<T>& p); template <typename T> const T& element_as_shared_ptr(const deepcopy_poly_ptr<T>& p); template <typename T> T implAsGetter(const yaml& p); template <typename T, typename YAML_T> void impl_mcp_save( YAML_T& y, const T& var, const char* varName ); template <typename T> T implAnyAsGetter(const mrpt::containers::yaml::scalar_t& s); std::string formatDouble(double val); std::optional<double> parseDouble(const std::string& s); std::string scalarToString(const mrpt::containers::yaml::scalar_t& s); } // namespace internal
Global Functions
std::string formatDouble(double val)
Formats a double with 17 significant digits (exact round trip), always with ‘.
‘ as decimal point, whatever the C or C++ global locale.
std::optional<double> parseDouble(const std::string& s)
Parses all of s as a floating-point number like std::strtod(), but always with ‘.
‘ as decimal point, whatever the current C locale (GUI toolkits often set one with a decimal comma). Returns std::nullopt if s is not a number, or if it overflows a double.
std::string scalarToString(const mrpt::containers::yaml::scalar_t& s)
Helper: convert a scalar_t to its YAML text representation.