Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkLexicalCast.h File Reference

Provides a robust lexical cast from strings to numeric types with a fallback for edge-case values. More...

#include <boost/lexical_cast.hpp>

Go to the source code of this file.

Namespaces

 mitk
 Find image slices visible on a given plane.
 
 boost
 

Functions

template<typename Target >
Target mitk::lexical_cast (const std::string &arg)
 Convert a string to a numeric target type with an std::istringstream fallback. More...
 
template<>
float boost::lexical_cast< float, std::string > (const std::string &arg)
 Specialization of boost::lexical_cast for string-to-float conversion. More...
 
template<>
double boost::lexical_cast< double, std::string > (const std::string &arg)
 Specialization of boost::lexical_cast for string-to-double conversion. More...
 
template<>
long double boost::lexical_cast< long double, std::string > (const std::string &arg)
 Specialization of boost::lexical_cast for string-to-long-double conversion. More...
 

Detailed Description

Provides a robust lexical cast from strings to numeric types with a fallback for edge-case values.

This header wraps boost::lexical_cast and adds a fallback using std::istringstream for certain compiler/platform combinations (e.g. Apple LLVM) that fail to convert very small floating-point numbers such as 0.2225e-307. It also provides template specializations that redirect boost::lexical_cast<float>, boost::lexical_cast<double>, and boost::lexical_cast<long\ double> through the MITK implementation.

Definition in file mitkLexicalCast.h.