From 5302adfdc7e6232c846b1d881e746fb6285ba550 Mon Sep 17 00:00:00 2001 From: Michael Jabbour Date: Thu, 26 Nov 2020 11:30:14 +0200 Subject: [PATCH] Remove unnecessary call to std::tie (fixes compilation error on MSVC 2017) (#137) * replace std::tie with simple tuple The call to std::tie was causing a compiler error on MSVC 2017. --- src/nlohmann/json-schema.hpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/nlohmann/json-schema.hpp b/src/nlohmann/json-schema.hpp index e312931..7979951 100644 --- a/src/nlohmann/json-schema.hpp +++ b/src/nlohmann/json-schema.hpp @@ -59,10 +59,9 @@ protected: // decodes a JSON uri and replaces all or part of the currently stored values void update(const std::string &uri); - std::tuple tie() const + std::tuple as_tuple() const { - return std::tie(urn_, scheme_, authority_, path_, - identifier_ != "" ? identifier_ : pointer_); + return {urn_, scheme_, authority_, path_, identifier_ != "" ? identifier_ : pointer_}; } public: @@ -115,12 +114,12 @@ public: friend bool operator<(const json_uri &l, const json_uri &r) { - return l.tie() < r.tie(); + return l.as_tuple() < r.as_tuple(); } friend bool operator==(const json_uri &l, const json_uri &r) { - return l.tie() == r.tie(); + return l.as_tuple() == r.as_tuple(); } friend std::ostream &operator<<(std::ostream &os, const json_uri &u);