mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
0e7bac9Fix include pathe5bb90fFix constness of Proxyac0142aUse template castef6e381Add missing Url.h include206e65cFix constness of operator[]695cc38Use template instantiation for friend declaration7b1e03aAdd BaseFromMember49bc04fMake List<>::Node not uncopyabled5954ffAdd Journal to UnitTest58da106Temporarily disable ServiceQueue dtor precondition assertsfe58c1aAdd missing #include2c02580Add PropertyStream for server state introspection24c2315Add ScopedWrapperContexta3845f5Add RelativeTime::value_type typedef7442932Fix missing PropertyStream membersed5a98fMore PropertyStream output for PeerFinderfcfa10dAdd PropertyStream3cf0729Tidy up AbstractHandler usage in HTTPClient55171f4Remove obsolete source files1311ca3Increase arity of SharedFunction67d807dAdd IPEndpoint::key_equalebf395eAdd ErrorCode and boost library2c3ead3Add ServiceQueue::wrap6c7f5d0Move many Thread related classes93e9d86Measure CPU utilization in ServiceQueueca47d72Move ServiceQueue, ThreadLocalValue, SpinLockc864e4dMove WaitableEventff305e6Add CPUMeter and ScopedTimeInterval01fd05cAdd RecursiveMutex, UnlockGuard, TryLockGuard5831a53Remove Journal from most Stoppable overridesb60a7f3Add Request and Response HTTP parsers44445ffRefactor net buffers classesac37c38Beast class refactor8b7056bFix eof on HTTP client get228b664Remove obsolete beast container classes1dfd655Use RelativeTime from startup in DeadlineTimerae22d5dAdd more methods to RelativeTimec67929eRemove unhandled exception catcher2472a90Add 64 bit output for MurmurHashf3d97c7Add RelativeTime::fromStartupb0b8660IPEndpoint better parsingae551cdAdd alternate form string parsing to IPEndpointd0a0dbfDon't break on Throw0e46762Add hasher functors for IPEndpointa1ec423Add Thread::stopThreadAsync4f7dca3Add compiler, stdlib, and platform skeleton to beast/config4394594Tidy up some use of Error for throwe5e0f52Journal console output improvementsf07515eAdd Stoppable prepare and start interfacesd37dd46Move RelativeTime to chrono, add ostream support3f6e7aaAdd console feature to Journalad0064aJournal option to write to Output window (MSVC)0b7574bAdd compilation test scriptcc05ce1Add ServiceQueuee132aabUse boost for functional when the config is set026b926Fix is_continuation for boost versionc807a4eFix invoked_type type reference2ff781bRemove LockFreeStack::size3acb474Add SharedData::ConstAccess7e4c834Add LockFreeStack::empty9c61a6dAdded AbstractHandler, WrapHandler. HTTPClient Fixes.94e40dcFix unittest, by removing recursive call.38bf408Fix nonstandard C++ extension in getNullSink1ef044dBuild fixesd5d3746Fix missing <cmath> include for Gentoo5f231d3Update copyright notice and licenses7b89bf6Add FixedArray, IntrusiveArray, Crypto5c5de57Reorganize beast modules and files9e18bb3Merge commit '43deaaa5cf0d0178a4a6c3cb69c02a2a9a43ec7d' as 'src/beast/beast/http/impl/http-parser'57703acFix BeforeBoost.h includefbc247bAdd Stoppable to beast56496d8IPEndpoint comparisons9d9c822Migrate some headers and general tidying1a3cddcAdd SharedArg and AsyncObject373ca9cAdd HTTPRequest and improvements to HTTPMessage parsing9534516Add some thread classes and fix SharedData with a simple mutex adapter755ab36Make CallQueue unit test runManualc0ca037Remove Beast version printing on startup7efb6a3Reorganize some MPL and Utility classes and files69c26a1Fix missing BeastConfig.h include in Net.cpp40aa552Disable Beast version printing in Ripple BeastConfig.h7b1352dAdd InterruptibleThread unit test68cf759ThreadWithCallQueue unit test adjustment6501deaIPEndpoint parsing and tidying72fc42bMove and add some template metaprogramming classes2a164f0Change filname capitalization (end)6a14f25Change filename capitalization92fd417Move integer types to beast/CStdInt.hebbd9ffMove TargetPlatform.h to beast/Config.h874b524Add IPEndpoint14b34fcTidy up some zlib macro undefines34fffcaRename beast sources for consistency4e59ab2Add CallQueue unit test327d7a6Fixes for consolidated beast unity includesd5ece4eRemove unused and broken classes39f13beRemove unused ConcurrentObject37624a7Add ThreadWithCallQueue unit teste82ec68Remove obsolete beast_Function90551a6Temporarily leave sqlite3 in whatever threading mode it was already in.43ebbb1Fix SharedSingleton to use memoryBarrierf343941Tidy up SharedSingleton doc comments001997eFix leak on exit from Singleton dependency cycle83b9d22Rename to DeadlineTimer::cancel()77874eeUse new instead of ::new for placement2a04dccJournal improvements50965caSharedFunction improvements277e32bAdd LockFreeStack iteratorsd94e4c2Fix undefined behavior in UnsignedIntegerCalc (again)2dc25ceFix DeadlineTimer, callback while holding lock207ffdeFix undefined behavior in UnsignedIntegerCalc1ad8ff9Fix UnsignedInteger::isZero1dd2836Add support for multiprecision integer arithmetic and binary data encodinga45fc47Update .gitignore962a95dTidy up UnsignedIntegerca695faAdd Time::isNull()e96ce99Better random number facilities in UnitTest550b8e5Fine tune UnsignedInteger declaration8e7e3b7Allow negative relative expirations in DeadlineTimerf3dc7ceAdd generic Journal class for loggingbfdda32Make ChildProcess UnitTest manual since it malfunctions02acf7dGeneral refactoring of beast framework classes84ef06eFix ExitHook to derive from AtExitHookf0acc9cReduce the max threads in the Workers unit test55447b0New SharedSingleton, resolves destruction of objects with static storage duration.41eb8a1Remove deprecated SharedPtr::getObject9eda4bcMake SharedObject members const, the counter mutable6eda777Remove deprecated createOnDemandOnce SingletonLifetime option8c522aaFix off by one in pending i/o count on HTTPClient057344eAdd HTTPMessage::toString and familyee728e3Add UniformResourceLocator::emptyae324fbMove ./modules to ./src git-subtree-dir: src/beast git-subtree-split:0e7bac945f
459 lines
16 KiB
C++
459 lines
16 KiB
C++
//------------------------------------------------------------------------------
|
|
/*
|
|
This file is part of Beast: https://github.com/vinniefalco/Beast
|
|
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
|
|
|
Portions of this file are from JUCE.
|
|
Copyright (c) 2013 - Raw Material Software Ltd.
|
|
Please visit http://www.juce.com
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted, provided that the above
|
|
copyright notice and this permission notice appear in all copies.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
*/
|
|
//==============================================================================
|
|
|
|
#ifndef BEAST_ARITHMETIC_H_INCLUDED
|
|
#define BEAST_ARITHMETIC_H_INCLUDED
|
|
|
|
#include "Config.h"
|
|
#include "CStdInt.h"
|
|
|
|
#include <cmath>
|
|
#include <algorithm>
|
|
|
|
namespace beast {
|
|
|
|
// Some indispensible min/max functions
|
|
|
|
/** Returns the larger of two values. */
|
|
template <typename Type>
|
|
inline Type bmax (const Type a, const Type b)
|
|
{ return (a < b) ? b : a; }
|
|
|
|
/** Returns the larger of three values. */
|
|
template <typename Type>
|
|
inline Type bmax (const Type a, const Type b, const Type c)
|
|
{ return (a < b) ? ((b < c) ? c : b) : ((a < c) ? c : a); }
|
|
|
|
/** Returns the larger of four values. */
|
|
template <typename Type>
|
|
inline Type bmax (const Type a, const Type b, const Type c, const Type d)
|
|
{ return bmax (a, bmax (b, c, d)); }
|
|
|
|
/** Returns the smaller of two values. */
|
|
template <typename Type>
|
|
inline Type bmin (const Type a, const Type b)
|
|
{ return (b < a) ? b : a; }
|
|
|
|
/** Returns the smaller of three values. */
|
|
template <typename Type>
|
|
inline Type bmin (const Type a, const Type b, const Type c)
|
|
{ return (b < a) ? ((c < b) ? c : b) : ((c < a) ? c : a); }
|
|
|
|
/** Returns the smaller of four values. */
|
|
template <typename Type>
|
|
inline Type bmin (const Type a, const Type b, const Type c, const Type d)
|
|
{ return bmin (a, bmin (b, c, d)); }
|
|
|
|
/** Scans an array of values, returning the minimum value that it contains. */
|
|
template <typename Type>
|
|
const Type findMinimum (const Type* data, int numValues)
|
|
{
|
|
if (numValues <= 0)
|
|
return Type();
|
|
|
|
Type result (*data++);
|
|
|
|
while (--numValues > 0) // (> 0 rather than >= 0 because we've already taken the first sample)
|
|
{
|
|
const Type& v = *data++;
|
|
if (v < result) result = v;
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/** Scans an array of values, returning the maximum value that it contains. */
|
|
template <typename Type>
|
|
const Type findMaximum (const Type* values, int numValues)
|
|
{
|
|
if (numValues <= 0)
|
|
return Type();
|
|
|
|
Type result (*values++);
|
|
|
|
while (--numValues > 0) // (> 0 rather than >= 0 because we've already taken the first sample)
|
|
{
|
|
const Type& v = *values++;
|
|
if (result < v) result = v;
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/** Scans an array of values, returning the minimum and maximum values that it contains. */
|
|
template <typename Type>
|
|
void findMinAndMax (const Type* values, int numValues, Type& lowest, Type& highest)
|
|
{
|
|
if (numValues <= 0)
|
|
{
|
|
lowest = Type();
|
|
highest = Type();
|
|
}
|
|
else
|
|
{
|
|
Type mn (*values++);
|
|
Type mx (mn);
|
|
|
|
while (--numValues > 0) // (> 0 rather than >= 0 because we've already taken the first sample)
|
|
{
|
|
const Type& v = *values++;
|
|
|
|
if (mx < v) mx = v;
|
|
if (v < mn) mn = v;
|
|
}
|
|
|
|
lowest = mn;
|
|
highest = mx;
|
|
}
|
|
}
|
|
|
|
//==============================================================================
|
|
/** Constrains a value to keep it within a given range.
|
|
|
|
This will check that the specified value lies between the lower and upper bounds
|
|
specified, and if not, will return the nearest value that would be in-range. Effectively,
|
|
it's like calling bmax (lowerLimit, bmin (upperLimit, value)).
|
|
|
|
Note that it expects that lowerLimit <= upperLimit. If this isn't true,
|
|
the results will be unpredictable.
|
|
|
|
@param lowerLimit the minimum value to return
|
|
@param upperLimit the maximum value to return
|
|
@param valueToConstrain the value to try to return
|
|
@returns the closest value to valueToConstrain which lies between lowerLimit
|
|
and upperLimit (inclusive)
|
|
@see blimit0To, bmin, bmax
|
|
*/
|
|
template <typename Type>
|
|
inline Type blimit (const Type lowerLimit,
|
|
const Type upperLimit,
|
|
const Type valueToConstrain) noexcept
|
|
{
|
|
bassert (lowerLimit <= upperLimit); // if these are in the wrong order, results are unpredictable..
|
|
|
|
return (valueToConstrain < lowerLimit) ? lowerLimit
|
|
: ((upperLimit < valueToConstrain) ? upperLimit
|
|
: valueToConstrain);
|
|
}
|
|
|
|
/** Returns true if a value is at least zero, and also below a specified upper limit.
|
|
This is basically a quicker way to write:
|
|
@code valueToTest >= 0 && valueToTest < upperLimit
|
|
@endcode
|
|
*/
|
|
template <typename Type>
|
|
inline bool isPositiveAndBelow (Type valueToTest, Type upperLimit) noexcept
|
|
{
|
|
bassert (Type() <= upperLimit); // makes no sense to call this if the upper limit is itself below zero..
|
|
return Type() <= valueToTest && valueToTest < upperLimit;
|
|
}
|
|
|
|
template <>
|
|
inline bool isPositiveAndBelow (const int valueToTest, const int upperLimit) noexcept
|
|
{
|
|
bassert (upperLimit >= 0); // makes no sense to call this if the upper limit is itself below zero..
|
|
return static_cast <unsigned int> (valueToTest) < static_cast <unsigned int> (upperLimit);
|
|
}
|
|
|
|
/** Returns true if a value is at least zero, and also less than or equal to a specified upper limit.
|
|
This is basically a quicker way to write:
|
|
@code valueToTest >= 0 && valueToTest <= upperLimit
|
|
@endcode
|
|
*/
|
|
template <typename Type>
|
|
inline bool isPositiveAndNotGreaterThan (Type valueToTest, Type upperLimit) noexcept
|
|
{
|
|
bassert (Type() <= upperLimit); // makes no sense to call this if the upper limit is itself below zero..
|
|
return Type() <= valueToTest && valueToTest <= upperLimit;
|
|
}
|
|
|
|
template <>
|
|
inline bool isPositiveAndNotGreaterThan (const int valueToTest, const int upperLimit) noexcept
|
|
{
|
|
bassert (upperLimit >= 0); // makes no sense to call this if the upper limit is itself below zero..
|
|
return static_cast <unsigned int> (valueToTest) <= static_cast <unsigned int> (upperLimit);
|
|
}
|
|
|
|
//==============================================================================
|
|
/** Handy function to swap two values. */
|
|
template <typename Type>
|
|
inline void swapVariables (Type& variable1, Type& variable2)
|
|
{
|
|
std::swap (variable1, variable2);
|
|
}
|
|
|
|
/** Handy function for getting the number of elements in a simple const C array.
|
|
E.g.
|
|
@code
|
|
static int myArray[] = { 1, 2, 3 };
|
|
|
|
int numElements = numElementsInArray (myArray) // returns 3
|
|
@endcode
|
|
*/
|
|
template <typename Type, int N>
|
|
int numElementsInArray (Type (&array)[N])
|
|
{
|
|
(void) array; // (required to avoid a spurious warning in MS compilers)
|
|
(void) sizeof (0[array]); // This line should cause an error if you pass an object with a user-defined subscript operator
|
|
return N;
|
|
}
|
|
|
|
//==============================================================================
|
|
// Some useful maths functions that aren't always present with all compilers and build settings.
|
|
|
|
/** Using beast_hypot is easier than dealing with the different types of hypot function
|
|
that are provided by the various platforms and compilers. */
|
|
template <typename Type>
|
|
inline Type beast_hypot (Type a, Type b) noexcept
|
|
{
|
|
#if BEAST_MSVC
|
|
return static_cast <Type> (_hypot (a, b));
|
|
#else
|
|
return static_cast <Type> (hypot (a, b));
|
|
#endif
|
|
}
|
|
|
|
/** 64-bit abs function. */
|
|
inline int64 abs64 (const int64 n) noexcept
|
|
{
|
|
return (n >= 0) ? n : -n;
|
|
}
|
|
|
|
//==============================================================================
|
|
/** A predefined value for Pi, at double-precision.
|
|
@see float_Pi
|
|
*/
|
|
const double double_Pi = 3.1415926535897932384626433832795;
|
|
|
|
/** A predefined value for Pi, at single-precision.
|
|
@see double_Pi
|
|
*/
|
|
const float float_Pi = 3.14159265358979323846f;
|
|
|
|
|
|
//==============================================================================
|
|
/** The isfinite() method seems to vary between platforms, so this is a
|
|
platform-independent function for it.
|
|
*/
|
|
template <typename FloatingPointType>
|
|
inline bool beast_isfinite (FloatingPointType value)
|
|
{
|
|
#if BEAST_WINDOWS
|
|
return _finite (value);
|
|
#elif BEAST_ANDROID
|
|
return isfinite (value);
|
|
#else
|
|
return std::isfinite (value);
|
|
#endif
|
|
}
|
|
|
|
//==============================================================================
|
|
#if BEAST_MSVC
|
|
#pragma optimize ("t", off)
|
|
#ifndef __INTEL_COMPILER
|
|
#pragma float_control (precise, on, push)
|
|
#endif
|
|
#endif
|
|
|
|
/** Fast floating-point-to-integer conversion.
|
|
|
|
This is faster than using the normal c++ cast to convert a float to an int, and
|
|
it will round the value to the nearest integer, rather than rounding it down
|
|
like the normal cast does.
|
|
|
|
Note that this routine gets its speed at the expense of some accuracy, and when
|
|
rounding values whose floating point component is exactly 0.5, odd numbers and
|
|
even numbers will be rounded up or down differently.
|
|
*/
|
|
template <typename FloatType>
|
|
inline int roundToInt (const FloatType value) noexcept
|
|
{
|
|
#ifdef __INTEL_COMPILER
|
|
#pragma float_control (precise, on, push)
|
|
#endif
|
|
|
|
union { int asInt[2]; double asDouble; } n;
|
|
n.asDouble = ((double) value) + 6755399441055744.0;
|
|
|
|
#if BEAST_BIG_ENDIAN
|
|
return n.asInt [1];
|
|
#else
|
|
return n.asInt [0];
|
|
#endif
|
|
}
|
|
|
|
#if BEAST_MSVC
|
|
#ifndef __INTEL_COMPILER
|
|
#pragma float_control (pop)
|
|
#endif
|
|
#pragma optimize ("", on) // resets optimisations to the project defaults
|
|
#endif
|
|
|
|
/** Fast floating-point-to-integer conversion.
|
|
|
|
This is a slightly slower and slightly more accurate version of roundDoubleToInt(). It works
|
|
fine for values above zero, but negative numbers are rounded the wrong way.
|
|
*/
|
|
inline int roundToIntAccurate (const double value) noexcept
|
|
{
|
|
#ifdef __INTEL_COMPILER
|
|
#pragma float_control (pop)
|
|
#endif
|
|
|
|
return roundToInt (value + 1.5e-8);
|
|
}
|
|
|
|
/** Fast floating-point-to-integer conversion.
|
|
|
|
This is faster than using the normal c++ cast to convert a double to an int, and
|
|
it will round the value to the nearest integer, rather than rounding it down
|
|
like the normal cast does.
|
|
|
|
Note that this routine gets its speed at the expense of some accuracy, and when
|
|
rounding values whose floating point component is exactly 0.5, odd numbers and
|
|
even numbers will be rounded up or down differently. For a more accurate conversion,
|
|
see roundDoubleToIntAccurate().
|
|
*/
|
|
inline int roundDoubleToInt (const double value) noexcept
|
|
{
|
|
return roundToInt (value);
|
|
}
|
|
|
|
/** Fast floating-point-to-integer conversion.
|
|
|
|
This is faster than using the normal c++ cast to convert a float to an int, and
|
|
it will round the value to the nearest integer, rather than rounding it down
|
|
like the normal cast does.
|
|
|
|
Note that this routine gets its speed at the expense of some accuracy, and when
|
|
rounding values whose floating point component is exactly 0.5, odd numbers and
|
|
even numbers will be rounded up or down differently.
|
|
*/
|
|
inline int roundFloatToInt (const float value) noexcept
|
|
{
|
|
return roundToInt (value);
|
|
}
|
|
|
|
//==============================================================================
|
|
/** Returns true if the specified integer is a power-of-two.
|
|
*/
|
|
template <typename IntegerType>
|
|
bool isPowerOfTwo (IntegerType value)
|
|
{
|
|
return (value & (value - 1)) == 0;
|
|
}
|
|
|
|
/** Returns the smallest power-of-two which is equal to or greater than the given integer.
|
|
*/
|
|
inline int nextPowerOfTwo (int n) noexcept
|
|
{
|
|
--n;
|
|
n |= (n >> 1);
|
|
n |= (n >> 2);
|
|
n |= (n >> 4);
|
|
n |= (n >> 8);
|
|
n |= (n >> 16);
|
|
return n + 1;
|
|
}
|
|
|
|
/** Performs a modulo operation, but can cope with the dividend being negative.
|
|
The divisor must be greater than zero.
|
|
*/
|
|
template <typename IntegerType>
|
|
IntegerType negativeAwareModulo (IntegerType dividend, const IntegerType divisor) noexcept
|
|
{
|
|
bassert (divisor > 0);
|
|
dividend %= divisor;
|
|
return (dividend < 0) ? (dividend + divisor) : dividend;
|
|
}
|
|
|
|
//==============================================================================
|
|
#if (BEAST_INTEL && BEAST_32BIT) || defined (DOXYGEN)
|
|
/** This macro can be applied to a float variable to check whether it contains a denormalised
|
|
value, and to normalise it if necessary.
|
|
On CPUs that aren't vulnerable to denormalisation problems, this will have no effect.
|
|
*/
|
|
#define BEAST_UNDENORMALISE(x) x += 1.0f; x -= 1.0f;
|
|
#else
|
|
#define BEAST_UNDENORMALISE(x)
|
|
#endif
|
|
|
|
//==============================================================================
|
|
/** This namespace contains a few template classes for helping work out class type variations.
|
|
*/
|
|
namespace TypeHelpers
|
|
{
|
|
#if BEAST_VC8_OR_EARLIER
|
|
#define PARAMETER_TYPE(type) const type&
|
|
#else
|
|
/** The ParameterType struct is used to find the best type to use when passing some kind
|
|
of object as a parameter.
|
|
|
|
Of course, this is only likely to be useful in certain esoteric template situations.
|
|
|
|
Because "typename TypeHelpers::ParameterType<SomeClass>::type" is a bit of a mouthful, there's
|
|
a PARAMETER_TYPE(SomeClass) macro that you can use to get the same effect.
|
|
|
|
E.g. "myFunction (PARAMETER_TYPE (int), PARAMETER_TYPE (MyObject))"
|
|
would evaluate to "myfunction (int, const MyObject&)", keeping any primitive types as
|
|
pass-by-value, but passing objects as a const reference, to avoid copying.
|
|
*/
|
|
template <typename Type> struct ParameterType { typedef const Type& type; };
|
|
|
|
#if ! DOXYGEN
|
|
template <typename Type> struct ParameterType <Type&> { typedef Type& type; };
|
|
template <typename Type> struct ParameterType <Type*> { typedef Type* type; };
|
|
template <> struct ParameterType <char> { typedef char type; };
|
|
template <> struct ParameterType <unsigned char> { typedef unsigned char type; };
|
|
template <> struct ParameterType <short> { typedef short type; };
|
|
template <> struct ParameterType <unsigned short> { typedef unsigned short type; };
|
|
template <> struct ParameterType <int> { typedef int type; };
|
|
template <> struct ParameterType <unsigned int> { typedef unsigned int type; };
|
|
template <> struct ParameterType <long> { typedef long type; };
|
|
template <> struct ParameterType <unsigned long> { typedef unsigned long type; };
|
|
template <> struct ParameterType <int64> { typedef int64 type; };
|
|
template <> struct ParameterType <uint64> { typedef uint64 type; };
|
|
template <> struct ParameterType <bool> { typedef bool type; };
|
|
template <> struct ParameterType <float> { typedef float type; };
|
|
template <> struct ParameterType <double> { typedef double type; };
|
|
#endif
|
|
|
|
/** A helpful macro to simplify the use of the ParameterType template.
|
|
@see ParameterType
|
|
*/
|
|
#define PARAMETER_TYPE(a) typename TypeHelpers::ParameterType<a>::type
|
|
#endif
|
|
|
|
|
|
/** These templates are designed to take a type, and if it's a double, they return a double
|
|
type; for anything else, they return a float type.
|
|
*/
|
|
template <typename Type> struct SmallestFloatType { typedef float type; };
|
|
template <> struct SmallestFloatType <double> { typedef double type; };
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|