Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F91947924
units.cc
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Nov 16, 00:57
Size
1 KB
Mime Type
text/x-c
Expires
Mon, Nov 18, 00:57 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22352284
Attached To
rMSPPROTO µSpectre prototype implementation
units.cc
View Options
/**
* file units.cc
*
* @author Till Junge <till.junge@epfl.ch>
*
* @date 04 May 2017
*
* @brief Definition of unit-related literals (have to be compiled only once!
*
* @section LICENCE
*
* Copyright (C) 2017 Till Junge
*
* µSpectre is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3, or (at
* your option) any later version.
*
* µSpectre is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNU Emacs; see the file COPYING. If not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "common/units.hh"
namespace
muSpectre
{
//----------------------------------------------------------------------------//
//! string literals for convenient use of units
#define LITERAL(literal_string) \
Quantity<Real, units::literal_string> operator""_##literal_string(long double r) { \
return Quantity<Real, units::literal_string>(Real(r)); \
} \
Quantity<Real, units::literal_string> operator""_##literal_string(unsigned long long r) { \
return Quantity<Real, units::literal_string>(Real(r)); \
}
// Warning: no literals seem possible for complex scalars
#define MACRO(r, dummy, literal_string) LITERAL(literal_string)
BOOST_PP_SEQ_FOR_EACH
(
MACRO
,
_
,
LITERALS
)
}
// muSpectre
Event Timeline
Log In to Comment