| |
|
|
Fortran Intrinsics and Additional Functions
Fortran intrinsic mathematical functions for which no standard C++ equivalent exists are provided as inline functions in the Fmath.hh header. This includes max and min functions with up to six arguments, two-argument max and min functions for numeric types that return by value (for efficiency), Fortran 95 bit functions, and equivalents to the Fortran MOD and SIGN functions. Additional mathematical functions are also provided in Fmath.hh.
Fortran character/string intrinsic functions are provided as part of the Fstring implementation. Member function equivalents are provided for most of these to facilitate migration to a more native C++ style. Other useful string functions are also provided in Fstring.
The char.functions module has a mix of functions for the char type, including implementations of the Fortran intrinsic ICHAR and IACHAR functions (ICHAR and IACHAR are also provided for Fstring).
The string.functions module has useful predicate, searching, and conversion functions for std::string, including std::string numeric conversion functions:
- The string_of( number ) functions provide a range of conversions to std::string.
- The is_type< numeric_type >( std::string ) function templates tests whether a std::string is a valid representation of a specified numeric type. Non-template wrapper functions for the common numeric types are provided for convenience: is_int, is_double, etc.
- The type_of< numeric_type >( std::string ) function templates convert a std::string to a specified numeric type. Non-template wrapper functions for the common numeric types are provided for convenience: int_of, double_of, etc.
The rvalue_cast function template allows the conversion of an rvalue to a non-const reference.
|
|
|
|