]> git.tdb.fi Git - libs/core.git/commitdiff
Require C++11 for building
authorMikko Rasa <tdb@tdb.fi>
Sun, 29 Aug 2021 09:18:17 +0000 (12:18 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sun, 29 Aug 2021 22:42:03 +0000 (01:42 +0300)
In practice this has been a requirement for a while due to libsigc++.

Build
source/core/noncopyable.h
source/debug/exceptiontrace.cpp
source/io/print.h
source/strings/format.h

diff --git a/Build b/Build
index 1321bb2760ca7c40c063e4f42caa9784b24da3a2..810880346774ca546a57a848b1be3c19aeeafa1a 100644 (file)
--- a/Build
+++ b/Build
@@ -7,6 +7,7 @@ package "mspcore"
        build_info
        {
                threads true;
        build_info
        {
                threads true;
+               standard CXX "c++11";
        };
        if_arch "linux"
        {
        };
        if_arch "linux"
        {
index b3dfca3c50c213bdf6aca880ffe9ebaa2fd24834..c948c57c7ab6b21e29e6f8036d7ff0f374bf21bd 100644 (file)
@@ -5,20 +5,11 @@ namespace Msp {
 
 class NonCopyable
 {
 
 class NonCopyable
 {
-#if __cplusplus >= 201103L
 protected:
        NonCopyable() = default;
        NonCopyable(const NonCopyable &) = delete;
        NonCopyable &operator=(const NonCopyable &) = delete;
        ~NonCopyable() = default;
 protected:
        NonCopyable() = default;
        NonCopyable(const NonCopyable &) = delete;
        NonCopyable &operator=(const NonCopyable &) = delete;
        ~NonCopyable() = default;
-#else
-private:
-       NonCopyable(const NonCopyable &) { }
-       NonCopyable &operator=(const NonCopyable &) { }
-protected:
-       NonCopyable() { }
-       ~NonCopyable() { }
-#endif
 };
 
 } // namespace Msp
 };
 
 } // namespace Msp
index fb72223a84df776ee7cbd30cc40bdf92ce0ff86f..8ffc9c81b988667cffa12d770c1a6e97e5244ba6 100644 (file)
@@ -32,13 +32,7 @@ bool trace_enabled = false;
 
 Msp::Debug::Backtrace &get_thread_backtrace()
 {
 
 Msp::Debug::Backtrace &get_thread_backtrace()
 {
-#if __cplusplus>=201103L
        static thread_local Msp::Debug::Backtrace backtrace;
        static thread_local Msp::Debug::Backtrace backtrace;
-#elif defined(__GNUC__)
-       static __thread Msp::Debug::Backtrace backtrace;
-#else
-       static Msp::Debug::Backtrace backtrace;
-#endif
        return backtrace;
 }
 
        return backtrace;
 }
 
index 29da9f4b2eab9bf07a7fbeff8ffe4c4624838632..85fd539ddc51f702cf2720a949e1bb4a0efd4dde 100644 (file)
@@ -15,65 +15,19 @@ completeness with the other print functions.
 inline unsigned print(Base &o, const std::string &f)
 { return o.write(f); }
 
 inline unsigned print(Base &o, const std::string &f)
 { return o.write(f); }
 
-#if __cplusplus>=201103L
 template<typename... Args>
 inline unsigned print(Base &o, const std::string &f, Args... args)
 { return print(o, format(f, args...)); }
 
 template<typename... Args>
 inline unsigned print(Base &o, const std::string &f, Args... args)
 { return print(o, format(f, args...)); }
 
-#else
-template<typename A1>
-inline unsigned print(Base &o, const std::string &f, A1 a1)
-{ return print(o, format(f, a1)); }
-
-template<typename A1, typename A2>
-inline unsigned print(Base &o, const std::string &f, A1 a1, A2 a2)
-{ return print(o, format(f, a1, a2)); }
-
-template<typename A1, typename A2, typename A3>
-inline unsigned print(Base &o, const std::string &f, A1 a1, A2 a2, A3 a3)
-{ return print(o, format(f, a1, a2, a3)); }
-
-template<typename A1, typename A2, typename A3, typename A4>
-inline unsigned print(Base &o, const std::string &f, A1 a1, A2 a2, A3 a3, A4 a4)
-{ return print(o, format(f, a1, a2, a3, a4)); }
-
-template<typename A1, typename A2, typename A3, typename A4, typename A5>
-inline unsigned print(Base &o, const std::string &f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
-{ return print(o, format(f, a1, a2, a3, a4, a5)); }
-#endif
-
 /* The following functions print to console */
 
 inline unsigned print(const std::string &f)
 { return print(cout, f); }
 
 /* The following functions print to console */
 
 inline unsigned print(const std::string &f)
 { return print(cout, f); }
 
-#if __cplusplus>=201103L
 template<typename... Args>
 inline unsigned print(const std::string &f, Args... args)
 { return print(cout, f, args...); }
 
 template<typename... Args>
 inline unsigned print(const std::string &f, Args... args)
 { return print(cout, f, args...); }
 
-#else
-template<typename A1>
-inline unsigned print(const std::string &f, A1 a1)
-{ return print(cout, f, a1); }
-
-template<typename A1, typename A2>
-inline unsigned print(const std::string &f, A1 a1, A2 a2)
-{ return print(cout, f, a1, a2); }
-
-template<typename A1, typename A2, typename A3>
-inline unsigned print(const std::string &f, A1 a1, A2 a2, A3 a3)
-{ return print(cout, f, a1, a2, a3); }
-
-template<typename A1, typename A2, typename A3, typename A4>
-inline unsigned print(const std::string &f, A1 a1, A2 a2, A3 a3, A4 a4)
-{ return print(cout, f, a1, a2, a3, a4); }
-
-template<typename A1, typename A2, typename A3, typename A4, typename A5>
-inline unsigned print(const std::string &f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
-{ return print(cout, f, a1, a2, a3, a4, a5); }
-#endif
-
 } // namespace IO
 } // namespace Msp
 
 } // namespace IO
 } // namespace Msp
 
index ea5d5b070090c770671fc7821435a520e333321c..49c40e9293512da2a656699d837f7f42834771c6 100644 (file)
@@ -31,13 +31,11 @@ public:
                return *this;
        }
 
                return *this;
        }
 
-#if __cplusplus>=201103L
        template<typename T, typename... Tail>
        Formatter &operator()(const T &a, const Tail &... tail)
        {
                return (*this)(a)(tail...);
        }
        template<typename T, typename... Tail>
        Formatter &operator()(const T &a, const Tail &... tail)
        {
                return (*this)(a)(tail...);
        }
-#endif
 
        /** Returns the result of the formatting operation.  Will throw if not
        enough values have been fed to the formatter. */
 
        /** Returns the result of the formatting operation.  Will throw if not
        enough values have been fed to the formatter. */
@@ -57,35 +55,12 @@ private:
 inline Formatter format(const std::string &f)
 { return Formatter(f); }
 
 inline Formatter format(const std::string &f)
 { return Formatter(f); }
 
-#if __cplusplus >= 201103L
 template<typename... Args>
 inline std::string format(const std::string &f, const Args &... args)
 {
        return Formatter(f)(args...).str();
 }
 
 template<typename... Args>
 inline std::string format(const std::string &f, const Args &... args)
 {
        return Formatter(f)(args...).str();
 }
 
-#else
-template<typename A1>
-inline std::string format(const std::string &f, const A1 &a1)
-{ return Formatter(f)(a1).str(); }
-
-template<typename A1, typename A2>
-inline std::string format(const std::string &f, const A1 &a1, const A2 &a2)
-{ return Formatter(f)(a1)(a2).str(); }
-
-template<typename A1, typename A2, typename A3>
-inline std::string format(const std::string &f, const A1 &a1, const A2 &a2, const A3 &a3)
-{ return Formatter(f)(a1)(a2)(a3).str(); }
-
-template<typename A1, typename A2, typename A3, typename A4>
-inline std::string format(const std::string &f, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4)
-{ return Formatter(f)(a1)(a2)(a3)(a4).str(); }
-
-template<typename A1, typename A2, typename A3, typename A4, typename A5>
-inline std::string format(const std::string &f, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5)
-{ return Formatter(f)(a1)(a2)(a3)(a4)(a5).str(); }
-#endif
-
 } // namespace Msp
 
 #endif
 } // namespace Msp
 
 #endif