[gnote] Update macros.hpp for required C++11



commit b028f494c70c62e1e1ae01a58154bf00241da219
Author: Aurimas Černius <aurisc4 gmail com>
Date:   Sun Jan 10 15:10:40 2016 +0200

    Update macros.hpp for required C++11

 src/base/macros.hpp |   37 ++++++++++---------------------------
 1 files changed, 10 insertions(+), 27 deletions(-)
---
diff --git a/src/base/macros.hpp b/src/base/macros.hpp
index bedaeb7..d95be52 100644
--- a/src/base/macros.hpp
+++ b/src/base/macros.hpp
@@ -1,7 +1,7 @@
 /*
  * gnote
  *
- * Copyright (C) 2013 Aurimas Cernius
+ * Copyright (C) 2013,2016 Aurimas Cernius
  * Copyright (C) 2009 Hubert Figuiere
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a
@@ -30,9 +30,7 @@
 #define __BASE_MACROS_
 
 #if __cplusplus < 201103L
-  #include <tr1/memory>
-  #include <boost/foreach.hpp>
-  #include <boost/lexical_cast.hpp>
+  #error "C++11 support is required"
 #else
   #include <memory>
   #include <string>
@@ -45,29 +43,14 @@
 #define _PRINTF_FORMAT(f,a)
 #endif
 
-// define 'final' and 'override' for pre-C++11 compilers
-#if __cplusplus < 201103L
-  #define final
-  #define override
-  #define FOREACH(var, container) BOOST_FOREACH(var, container)
-  #define TO_STRING(x) boost::lexical_cast<std::string>(x)
-  #define STRING_TO_INT(x) boost::lexical_cast<int>(x)
-
-  using std::tr1::shared_ptr;
-  using std::tr1::weak_ptr;
-  using std::tr1::enable_shared_from_this;
-  using std::tr1::dynamic_pointer_cast;
-  using std::tr1::static_pointer_cast;
-#else
-  #define FOREACH(var, container) for(var : container)
-  #define TO_STRING(x) std::to_string(x)
-  #define STRING_TO_INT(x) std::stoi(x)
+#define FOREACH(var, container) for(var : container)
+#define TO_STRING(x) std::to_string(x)
+#define STRING_TO_INT(x) std::stoi(x)
 
-  using std::shared_ptr;
-  using std::weak_ptr;
-  using std::enable_shared_from_this;
-  using std::dynamic_pointer_cast;
-  using std::static_pointer_cast;
-#endif
+using std::shared_ptr;
+using std::weak_ptr;
+using std::enable_shared_from_this;
+using std::dynamic_pointer_cast;
+using std::static_pointer_cast;
 
 #endif


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]