complex_public.h
1//-*-C++-*-
2/***************************************************************************
3 *
4 * Copyright (C) 2006 by Willem van Straten
5 * Licensed under the Academic Free License version 2.1
6 *
7 ***************************************************************************/
8// psrchive/Util/units/complex_public.h
9
10#ifndef __complex_public
11#define __complex_public
12
13#include <complex>
14
16template<class T>
18public:
19 T real;
20 T imag;
21};
22
23template<class T>
24complex_public<T>& pub (std::complex<T>& c)
25{
26 return *reinterpret_cast< complex_public<T>* >( &c );
27}
28
29template<class T>
30const complex_public<T>& pub (const std::complex<T>& c)
31{
32 return *reinterpret_cast< const complex_public<T>* >( &c );
33}
34
35#endif
simple template used to provide public access to std::complex::real|imag
Definition complex_public.h:17

Generated using doxygen 1.14.0