diff options
author | Egor Pugin <egor.pugin@gmail.com> | 2020-03-15 13:43:30 +0300 |
---|---|---|
committer | Egor Pugin <egor.pugin@gmail.com> | 2020-03-15 13:43:30 +0300 |
commit | a1acba9a850cf80cf645756dd938940beafa57e7 (patch) | |
tree | a712b6f955bd496df04dfc4591284db2f7cc301a | |
parent | b780dfdf19b86b500295d43c19f8f8cf914b61b5 (diff) |
Use make_unique if C++14 and above is available. Kudos to @JellyBrick.
-rw-r--r-- | src/Bot.cpp | 6 | ||||
-rw-r--r-- | sw.cpp | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/Bot.cpp b/src/Bot.cpp index 8e6d667..706a3ce 100644 --- a/src/Bot.cpp +++ b/src/Bot.cpp @@ -7,9 +7,11 @@ namespace TgBot { Bot::Bot(std::string token, const HttpClient& httpClient) : _token(std::move(token)) , _api(_token, httpClient) - // uncomment when c++14 is available - //, _eventBroadcaster(std::make_unique<EventBroadcaster>()) +#if __cplusplus > 201103L + , _eventBroadcaster(std::make_unique<EventBroadcaster>()) +#else , _eventBroadcaster(new EventBroadcaster()) +#endif , _eventHandler(getEvents()) { } @@ -6,6 +6,10 @@ void build(Solution &s) tgbot += cpp11; tgbot.ApiName = "TGBOT_API"; + + if (tgbot.getCompilerType() == CompilerType::MSVC) + tgbot.CompileOptions.push_back("/Zc:__cplusplus"); + tgbot.Public += "org.sw.demo.boost.property_tree"_dep; tgbot.Public += "org.sw.demo.openssl.ssl"_dep; tgbot.Public += "org.sw.demo.boost.system"_dep; |