JayBeams  0.1
Another project to have fun coding.
Classes | Namespaces
complex_traits.hpp File Reference
#include <complex>

Go to the source code of this file.

Classes

struct  jb::extract_value_type< T >
 Generic function to extract the floating point type of std::complex. More...
 
struct  jb::extract_value_type< std::complex< T > >
 Partial specialization of jb::extract_value_type for std::complex. More...
 

Namespaces

 jb
 The top-level namespace for the JayBeams library.
 

Class Documentation

◆ jb::extract_value_type

struct jb::extract_value_type

template<typename T>
struct jb::extract_value_type< T >

Generic function to extract the floating point type of std::complex.

Some of the algorithms and data structures in JayBeams need to work for both std::complex<> and for primitive floating point values such as 'float'. These functions sometimes need a generic way to extract the 'T' parameter in a std::complex<T>. This function can be used to perform such conversions, for example:

template<typename sample_t> class Foo {
typedef typename jb::extra_value_type<sample_t>::precision prec;
prec epsilon = std::numeric_limits<prec>::epsilon();
};

Such code would work whether sample_t is a std::complex<T> or a primitive floating point value.

Definition at line 28 of file complex_traits.hpp.

Class Members
typedef T precision

◆ jb::extract_value_type< std::complex< T > >

struct jb::extract_value_type< std::complex< T > >

template<typename T>
struct jb::extract_value_type< std::complex< T > >

Partial specialization of jb::extract_value_type for std::complex.

Definition at line 34 of file complex_traits.hpp.

Class Members
typedef T precision