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

@@ -7,6 +7,7 @@
#include "Storage.h"
#include <cctype>
#include <string>
#include <tuple>
@@ -567,7 +568,8 @@ static void WriteString(std::ostream& os, llvm::StringRef str) {
void Storage::SavePersistent(std::ostream& os) const {
// copy values out of storage as quickly as possible so lock isn't held
std::vector<std::pair<std::string, std::shared_ptr<Value>>> entries;
typedef std::pair<std::string, std::shared_ptr<Value>> NewEntry;
std::vector<NewEntry> entries;
{
std::lock_guard<std::mutex> lock(m_mutex);
entries.reserve(m_entries.size());
@@ -581,7 +583,7 @@ void Storage::SavePersistent(std::ostream& os) const {
// sort in name order
std::sort(entries.begin(), entries.end(),
[](const auto& a, const auto& b) { return a.first < b.first; });
[](const NewEntry& a, const NewEntry& b) { return a.first < b.first; });
std::string base64_encoded;