Commit 586e75b9 authored by Thomas Corbat's avatar Thomas Corbat
Browse files

exercise templates w7

parent 2c44ee69
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>w09_solution_01_CompileTimeFibonacci</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>ch.hsr.ifs.cute.ui.cutenature</nature>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.core.ccnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
</natures>
</projectDescription>
/*********************************************************************************
* This file is part of CUTE.
*
* Copyright (c) 2006-2018 Peter Sommerlad, IFS
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*********************************************************************************/
#ifndef CUTE_H_
#define CUTE_H_
// all CUTE includes for writing tests and suites
#include "cute_base.h"
#include "cute_equals.h"
#include "cute_relops.h"
#include "cute_data_driven.h"
#include "cute_throws.h"
#include "cute_suite.h"
#include "cute_repeated_test.h"
#include "cute_suite_test.h"
#include "cute_test_incarnate.h"
#include "cute_test.h"
#include "cute_testmember.h"
#include "cute_version.h"
#endif /*CUTE_H_*/
/*********************************************************************************
* This file is part of CUTE.
*
* Copyright (c) 2007-2018 Peter Sommerlad, IFS
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*********************************************************************************/
#ifndef CUTE_BASE_H_
#define CUTE_BASE_H_
#include <string>
#include "cute_to_string.h"
#include "cute_determine_version.h"
namespace cute {
struct test_failure {
std::string reason;
std::string filename;
int lineno;
test_failure(std::string const &r,char const *f, int line)
:reason(r),filename(f),lineno(line)
{ }
char const * what() const { return reason.c_str(); }
};
}
#if defined(USE_STD11) && !defined(_MSC_VER)
#define CUTE_FUNCNAME_PREFIX std::string(__func__)+": "
#else
#if defined( _MSC_VER ) || defined(__GNUG__)
//#if defined(USE_STD11)
//#define CUTE_FUNCNAME_PREFIX
// workaround doesn't work namespace { char const __FUNCTION__ []="lambda";}
// MSC can not use lambdas outside of function bodies for tests.
//#endif
// use -D CUTE_FUNCNAME_PREFIX if you want to use non-local lambdas with test macros
#if !defined(CUTE_FUNCNAME_PREFIX)
#define CUTE_FUNCNAME_PREFIX std::string(__FUNCTION__)+": "
#endif
#else // could provide #defines for other compiler-specific extensions... need to experiment, i.e., MS uses __FUNCTION__
#define CUTE_FUNCNAME_PREFIX std::string("")
#endif
#endif
#define ASSERTM(msg,cond) do { if (!(cond)) throw cute::test_failure(CUTE_FUNCNAME_PREFIX+cute::cute_to_string::backslashQuoteTabNewline(msg),__FILE__,__LINE__);} while(false)
#define ASSERT(cond) ASSERTM(#cond,cond)
#define FAIL() ASSERTM("FAIL()",false)
#define FAILM(msg) ASSERTM(msg,false)
#endif /*CUTE_BASE_H_*/
/*********************************************************************************
* This file is part of CUTE.
*
* Copyright (c) 2007-2018 Peter Sommerlad, IFS
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*********************************************************************************/
#ifndef CUTE_COUNTING_LISTENER_H_
#define CUTE_COUNTING_LISTENER_H_
#include "cute_listener.h"
namespace cute{
template <typename Listener=null_listener>
struct counting_listener:Listener{
counting_listener()
:Listener()
,numberOfTests(0),successfulTests(0),failedTests(0),errors(0),numberOfSuites(0),numberOfTestsInSuites(0){}
counting_listener(Listener const &s)
:Listener(s)
,numberOfTests(0),successfulTests(0),failedTests(0),errors(0),numberOfSuites(0),numberOfTestsInSuites(0){}
void begin(suite const &s,char const *info, size_t n_of_tests){
++numberOfSuites;
numberOfTestsInSuites+=n_of_tests;
Listener::begin(s,info, n_of_tests);
}
void start(test const &t){
++numberOfTests;
Listener::start(t);
}
void success(test const &t,char const *msg){
++successfulTests;
Listener::success(t,msg);
}
void failure(test const &t,test_failure const &e){
++failedTests;
Listener::failure(t,e);
}
void error(test const &t,char const *what){
++errors;
Listener::error(t,what);
}
size_t numberOfTests;
size_t successfulTests;
size_t failedTests;
size_t errors;
size_t numberOfSuites;
size_t numberOfTestsInSuites;
};
}
#endif /*CUTE_COUNTING_LISTENER_H_*/
/*********************************************************************************
* This file is part of CUTE.
*
* Copyright (c) 2013-2018 Peter Sommerlad, IFS
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*********************************************************************************/
#ifndef CUTE_DATA_DRIVEN_H_
#define CUTE_DATA_DRIVEN_H_
#include "cute_base.h"
#include "cute_equals.h"
#include "cute_relops.h"
#define DDTM(msg) (cute::test_failure(cute::cute_to_string::backslashQuoteTabNewline(msg),__FILE__,__LINE__))
#define DDT() DDTM("")
#define ASSERT_DDTM(cond,msg,failure) do{ \
if (!(cond)) \
throw cute::test_failure(CUTE_FUNCNAME_PREFIX+cute::cute_to_string::backslashQuoteTabNewline(msg)+(failure).reason,\
(failure).filename.c_str(),(failure).lineno);\
} while (false)
#define ASSERT_DDT(cond,failure) ASSERT_DDTM(cond,#cond,(failure))
#define ASSERT_EQUAL_DDTM(msg,expected,actual,failure) cute::assert_equal((expected),(actual),\
CUTE_FUNCNAME_PREFIX+cute::cute_to_string::backslashQuoteTabNewline(msg)\
+(failure).reason,(failure).filename.c_str(),(failure).lineno)
#define ASSERT_EQUAL_DDT(expected,actual,failure) ASSERT_EQUAL_DDTM(#expected " == " #actual, (expected),(actual),(failure))
#define ASSERT_EQUAL_DELTA_DDTM(msg,expected,actual,delta,failure) cute::assert_equal_delta((expected),(actual),(delta),\
CUTE_FUNCNAME_PREFIX+cute::cute_to_string::backslashQuoteTabNewline(msg)\
+(failure).reason,(failure).filename.c_str(),(failure).lineno)
#define ASSERT_EQUAL_DELTA_DDT(expected,actual,delta,failure) ASSERT_EQUAL_DELTA_DDTM(#expected " == " #actual " with error " #delta ,(expected),(actual),(delta),(failure))
#define ASSERT_LESS_DDTM(msg,left,right,failure) cute::assert_relop<std::less>((left),(right),\
CUTE_FUNCNAME_PREFIX+cute::cute_to_string::backslashQuoteTabNewline(msg)\
+(failure).reason,(failure).filename.c_str(),(failure).lineno)
#define ASSERT_LESS_DDT(left,right,failure) ASSERT_LESS_DDTM(#left " < " #right, (left),(right),(failure))
#define ASSERT_LESS_EQUAL_DDTM(msg,left,right,failure) cute::assert_relop<std::less_equal>((left),(right),\
CUTE_FUNCNAME_PREFIX+cute::cute_to_string::backslashQuoteTabNewline(msg)\
+(failure).reason,(failure).filename.c_str(),(failure).lineno)
#define ASSERT_LESS_EQUAL_DDT(left,right,failure) ASSERT_LESS_EQUAL_DDTM(#left " <= " #right, (left),(right),(failure))
#define ASSERT_GREATER_DDTM(msg,left,right,failure) cute::assert_relop<std::greater>((left),(right),\
CUTE_FUNCNAME_PREFIX+cute::cute_to_string::backslashQuoteTabNewline(msg)\
+(failure).reason,(failure).filename.c_str(),(failure).lineno)
#define ASSERT_GREATER_DDT(left,right,failure) ASSERT_GREATER_DDTM(#left " > " #right, (left),(right),(failure))
#define ASSERT_GREATER_EQUAL_DDTM(msg,left,right,failure) cute::assert_relop<std::greater_equal>((left),(right),\
CUTE_FUNCNAME_PREFIX+cute::cute_to_string::backslashQuoteTabNewline(msg)\
+(failure).reason,(failure).filename.c_str(),(failure).lineno)
#define ASSERT_GREATER_EQUAL_DDT(left,right,failure) ASSERT_GREATER_EQUAL_DDTM(#left " >= " #right, (left),(right),(failure))
#define ASSERT_NOT_EQUAL_TO_DDTM(msg,left,right,failure) cute::assert_relop<std::not_equal_to>((left),(right),\
CUTE_FUNCNAME_PREFIX+cute::cute_to_string::backslashQuoteTabNewline(msg)\
+(failure).reason,(failure).filename.c_str(),(failure).lineno)
#define ASSERT_NOT_EQUAL_TO_DDT(left,right,failure) ASSERT_NOT_EQUAL_TO_DDTM(#left " != " #right, (left),(right),(failure))
#endif /* CUTE_DATA_DRIVEN_H_ */
/*********************************************************************************
* This file is part of CUTE.
*
* Copyright (c) 2009-2018 Peter Sommerlad, IFS
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*********************************************************************************/
#ifndef CUTE_DEMANGLE_H_
#define CUTE_DEMANGLE_H_
#include <string>
// needs adaptation for different compilers
// dependency to demangle is a given,
// otherwise we have to use macros everywhere
#ifdef __GNUG__ // also for clang...
#include <cxxabi.h> // __cxa_demangle
#include <cstdlib> // ::free()
namespace cute {
extern inline std::string demangle(char const *name);
namespace cute_impl_demangle {
inline std::string plain_demangle(char const *name){
if (!name) return "unknown";
char const *toBeFreed = abi::__cxa_demangle(name,0,0,0);
std::string result(toBeFreed?toBeFreed:name);
::free(const_cast<char*>(toBeFreed));
return result;
}
#if defined(_LIBCPP_NAMESPACE) || defined(_GLIBCXX_USE_CXX11_ABI)
inline void patch_library_namespace(std::string &mightcontaininlinenamespace) {
// libc++ uses inline namespace std::_LIBCPP_NAMESPACE:: for its classes. This breaks the tests relying on meta information. re-normalize the names back to std::
// libstdc++ (at least in version 6.3.1) puts some STL classes into the inline namespace std::_GLIBCXX_NAMESPACE_CXX11 if in C++11 mode
std::string::size_type pos=std::string::npos;
#define XNS(X) #X
#define NS(X) XNS(X)
#ifdef _LIBCPP_NAMESPACE
#define TOREPLACE "::" NS(_LIBCPP_NAMESPACE)
#else
#define TOREPLACE "::" NS(_GLIBCXX_NAMESPACE_CXX11)
#endif
std::string const nothing;
while (std::string::npos != (pos= mightcontaininlinenamespace.find(TOREPLACE)))
mightcontaininlinenamespace.erase(pos,sizeof(TOREPLACE)-1);
#undef NS
#undef XNS
#undef TOREPLACE
}
inline void patchresultforstring(std::string& result) {
static const std::string stringid=plain_demangle(typeid(std::string).name());
std::string::size_type pos=std::string::npos;
while(std::string::npos != (pos=result.find(stringid))){
if (!result.compare(pos+stringid.size(),2," >",2)) result.erase(pos+stringid.size(),1); // makes templates look nice
result.replace(pos,stringid.size(),"std::string");
}
patch_library_namespace(result);
}
#endif
}
inline std::string demangle(char const *name){
if (!name) return "unknown";
std::string result(cute_impl_demangle::plain_demangle(name));
#if defined(_LIBCPP_NAMESPACE) || defined(_GLIBCXX_USE_CXX11_ABI)
cute_impl_demangle::patchresultforstring(result);
#endif
return result;
}
}
#else
namespace cute {
#ifdef _MSC_VER
namespace cute_demangle_impl {
inline void removeMSKeyword(std::string &name,std::string const &kw){
std::string::size_type pos=std::string::npos;
while (std::string::npos != (pos= name.find(kw)))
name.erase(pos,kw.size());
}
inline void patchresultforstring(std::string& result) {
static const std::string stringid=(typeid(std::string).name());
std::string::size_type pos=std::string::npos;
while(std::string::npos != (pos=result.find(stringid))){
if (!result.compare(pos+stringid.size(),2," >",2)) result.erase(pos+stringid.size(),1); // makes templates look nice
result.replace(pos,stringid.size(),"std::string");
}
}
inline void patchMSMangling(std::string &name){
patchresultforstring(name);
removeMSKeyword(name,"class ");
removeMSKeyword(name,"struct ");
for (std::string::iterator i=name.begin(); i != name.end(); ++i){
if (*i==','){ i = name.insert(i+1,' ');}
}
std::string::size_type pos=0;
while(std::string::npos !=(pos=name.find(" ,",pos))){
name.erase(pos,1);
++pos;
}
}
}
inline std::string demangle(char const *name){
std::string result(name?name:"unknown");
cute_demangle_impl::patchMSMangling(result);
return result;
}
#else
// this default works reasonably with MSVC71 and 8, hopefully for others as well
inline std::string demangle(char const *name){
return std::string(name?name:"unknown");
}
#endif
}
#endif
#endif /* CUTE_DEMANGLE_H_ */
/*********************************************************************************
* This file is part of CUTE.
*
* Copyright (c) 2016-2018 Peter Sommerlad, IFS
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*********************************************************************************/
#ifndef CUTE_DEPRECATED_H_
#define CUTE_DEPRECATED_H_
#if __cplusplus >= 201402L
#define DEPRECATE(orig, repl) [[deprecated ("Use "#repl" instead.")]] inline void orig() {}
#elif defined(__GNUG__)
#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
#if GCC_VERSION >= 40500 || defined(__clang__)
#define DEPRECATE(orig, repl) __attribute__((deprecated("Use "#repl" instead."))) inline void orig() {}
#else
#define DEPRECATE(orig, repl) __attribute__((deprecated)) inline void orig() {}
#endif
#elif defined(_MSC_VER)
#define DEPRECATE(orig, repl) __declspec(deprecated(#orig" is deprecated, use "#repl" instead.")) inline void orig() {}
#endif
#ifdef DEPRECATE
#define DEPRECATED(name) name()
#endif
#endif /*CUTE_DEPRECATED_H_*/
/*********************************************************************************
* This file is part of CUTE.
*
* Copyright (c) 2007-2018 Peter Sommerlad, IFS
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*********************************************************************************/
#ifndef CUTE_DETERMINE_LIBRARY_H_
#define CUTE_DETERMINE_LIBRARY_H_
#if defined(USE_TR1)
#include <tr1/functional>
// bind already given by <functional> in cute_test.h from cute_suite.h
namespace boost_or_tr1 = std::tr1;
namespace cute {
using namespace boost_or_tr1::placeholders;
}
#elif defined(USE_STD11)
#include <functional>
namespace boost_or_tr1 = std;
namespace cute {
using namespace boost_or_tr1::placeholders;
}
#else
#include <boost/bind.hpp>
#include <boost/function.hpp>
namespace boost_or_tr1 = boost;
#endif
#endif /*CUTE_DETERMINE_LIBRARY_H_*/
/*********************************************************************************
* This file is part of CUTE.
*
* Copyright (c) 2013-2018 Peter Sommerlad, IFS
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*********************************************************************************/
#ifndef CUTE_DETERMINE_TRAITS_H_
#define CUTE_DETERMINE_TRAITS_H_
#include "cute_determine_version.h"
#if defined(USE_STD11)
#include <type_traits>
#elif defined(USE_TR1)
#include <tr1/type_traits>
#else
#include <boost/type_traits/is_integral.hpp>
#include <boost/type_traits/is_floating_point.hpp>
#include <boost/type_traits/make_signed.hpp>
#endif
#if defined(USE_STD11)
namespace impl_place_for_traits = std;
#elif defined(USE_TR1)
namespace impl_place_for_traits = std::tr1;
#else
namespace impl_place_for_traits = boost;
#endif
#endif /* CUTE_DETERMINE_TRAITS_H_ */