mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-02 02:51:42 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user