From 54870fb76b5f59cc2e6d69a8c7a8ef17853a0029 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 5 Dec 2016 15:09:04 +0200 Subject: Add comma, ternary, logical operators support in eval context --- build2/variable.txx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'build2/variable.txx') diff --git a/build2/variable.txx b/build2/variable.txx index ab31a45..d566a04 100644 --- a/build2/variable.txx +++ b/build2/variable.txx @@ -35,6 +35,20 @@ namespace build2 } template + T + convert (value&& v) + { + if (v.type == nullptr) + return convert (move (v).as ()); + else if (v.type == &value_traits::value_type) + return move (v).as (); + + throw invalid_argument ( + string ("invalid ") + value_traits::type_name + + " value: conversion from " + v.type->name); + } + + template void default_dtor (value& v) { -- cgit v1.1