Visual Studio 2013 compilation fixes.

- Missing header file callouts in some cases (library deltas)
- Lack of support for auto parameters in lambdas
- Defining of ERROR by windows.h
- Dispatcher::Connection needs a move constructor (default not generated)
- Need explicit enable_if on std::string move template in Value to avoid trying to move const char[] (string literal)
- Compile flags
This commit is contained in:
Peter Johnson
2015-08-03 01:23:42 -07:00
parent a86f65db1e
commit 4146db6fc8
9 changed files with 21 additions and 7 deletions

View File

@@ -11,6 +11,7 @@
#include <cassert>
#include <memory>
#include <string>
#include <type_traits>
#include <vector>
#include "llvm/ArrayRef.h"
@@ -103,7 +104,7 @@ class Value {
val->m_val.data.v_string.len = val->m_string.size();
return val;
}
template <typename T>
template <typename T, typename = std::enable_if_t<std::is_same<T, std::string>>>
static std::shared_ptr<Value> MakeString(T&& value) {
auto val = std::make_shared<Value>(NT_STRING, private_init());
val->m_string = std::move(value);
@@ -118,7 +119,7 @@ class Value {
val->m_val.data.v_raw.len = val->m_string.size();
return val;
}
template <typename T>
template <typename T, typename = std::enable_if_t<std::is_same<T, std::string>>>
static std::shared_ptr<Value> MakeRaw(T&& value) {
auto val = std::make_shared<Value>(NT_RAW, private_init());
val->m_string = std::move(value);