// file : build/variable.cxx -*- C++ -*- // copyright : Copyright (c) 2014-2015 Code Synthesis Ltd // license : MIT; see accompanying LICENSE file #include #include using namespace std; namespace build { variable_set variable_pool; // value_proxy // template <> const string& value_proxy:: as () const { const list_value& lv (as ()); assert (lv.size () < 2); if (lv.empty ()) return empty_string; const name& n (lv.front ()); assert (n.type.empty () && n.dir.empty ()); return n.value; } template <> const dir_path& value_proxy:: as () const { const list_value& lv (as ()); assert (lv.size () < 2); if (lv.empty ()) return empty_dir_path; const name& n (lv.front ()); assert (n.type.empty () && n.value.empty ()); return n.dir; } }