From e0de4f26fcf598b4f6beaa2847c4d43a4c761f5b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 1 Apr 2015 12:18:40 +0200 Subject: Warn about configured/command line value mismatch Also store configured but unspecified values --- build/variable.ixx | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 build/variable.ixx (limited to 'build/variable.ixx') diff --git a/build/variable.ixx b/build/variable.ixx new file mode 100644 index 0000000..85fdd50 --- /dev/null +++ b/build/variable.ixx @@ -0,0 +1,46 @@ +// file : build/variable.ixx -*- C++ -*- +// copyright : Copyright (c) 2014-2015 Code Synthesis Tools CC +// license : MIT; see accompanying LICENSE file + +namespace build +{ + inline const value_proxy& value_proxy:: + operator= (value_ptr v) const + { + assert (v == nullptr || &v->scope == s); + *p = std::move (v); + return *this; + } + + inline const value_proxy& value_proxy:: + operator= (const value_proxy& v) const + { + if (this != &v) + { + if (v) + *p = v.as ().clone (*s); + else + p->reset (); + } + + return *this; + } + + inline const value_proxy& value_proxy:: + operator= (std::string v) const + { + // In most cases this is used to initialize a new variable, so + // don't bother trying to optimize for the case where p is not + // NULL. + // + p->reset (new list_value (*s, std::move (v))); + return *this; + } + + inline const value_proxy& value_proxy:: + operator= (path v) const + { + p->reset (new list_value (*s, std::move (v))); + return *this; + } +} -- cgit v1.1