OSDN Git Service

* C++11対応でないコンパイラは弾くような判定を追加
authorcaprice <caprice@users.sourceforge.jp>
Sun, 20 Apr 2014 13:42:47 +0000 (22:42 +0900)
committercaprice <caprice@users.sourceforge.jp>
Sun, 20 Apr 2014 13:42:47 +0000 (22:42 +0900)
* libsqlitexxの名前空間に対するエイリアスの宣言を追加
* std::enable_if<>の定石パターンを切り出してその定義を追加

include/GikoMona.hpp

index 377c047..29d4251 100644 (file)
@@ -3,27 +3,47 @@
 
 #include <type_traits>
 
+#include <boost/config.hpp>
 #include <boost/filesystem/path.hpp>
 
+/// @breif libbbs で string に関わる typedef を抑制する。@link libbbs/settings.hpp @endlink を見よ。
+#define LIBBBS_USED_BY_GIKOMONA
+#define LIBSQLITEXX_USED_BY_GIKOMONA
+
 #include "string.hpp"
 
+#include <sqlitexx.hpp>
+
+#if __cplusplus < 201103L
+    #error "[GikoMona.libcore @pp-time] : sorry, this compiler does NOT support C++11."
+#endif
+
 namespace monazilla { namespace GikoMona {
 
 namespace core {
 
+namespace sqlite = caprice::sqlitexx;
+
 bool init_core();
 void done_core() noexcept ;
 void optimize_database(const boost::filesystem::path& db_path);
 
+// for std::enable_if<T>
 extern void *enabler;
+    
+template <typename T, typename U>
+using enable_if_T_is_same_as_U
+    = typename std::enable_if<std::is_same<T, U>::value>::type*& ;
+
+// for communication.hpp
+typedef int communicate_id;
+std::string to_string(const communicate_id val);
+    
 
 }
 
 } }
 
-/// @breif libbbs で string に関わる typedef を抑制する。@link libbbs/settings.hpp @endlink を見よ。
-#define LIBBBS_PRAGMA_USED_BY_GIKOMONA
-#define LIBSQLITEXX_PRAGMA_USED_BY_GIKOMONA
 
 #define PROJECT_NAME "GikoMona project, powered by monazilla.org."
 #define PROJECT_URL "http://sourceforge.jp/projects/gikomona/"