From 5badf4672d3c647465e1764006440beb5c5109d8 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 23 Aug 2019 09:55:28 +0200 Subject: MSVC fix --- libbuild2/action.hxx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'libbuild2/action.hxx') diff --git a/libbuild2/action.hxx b/libbuild2/action.hxx index 9fa2a16..01c5307 100644 --- a/libbuild2/action.hxx +++ b/libbuild2/action.hxx @@ -116,10 +116,18 @@ namespace build2 template struct action_state { - T data[2]; // [0] -- inner, [1] -- outer. + T inner; + T outer; - T& operator[] (action a) {return data[a.inner () ? 0 : 1];} - const T& operator[] (action a) const {return data[a.inner () ? 0 : 1];} + T& operator[] (action a) {return a.inner () ? inner : outer;} + const T& operator[] (action a) const {return a.inner () ? inner : outer;} + + action_state () = default; + + template + explicit + action_state (A&&... a) + : inner (forward (a)...), outer (forward (a)...) {} }; // Id constants for build-in and pre-defined meta/operations. -- cgit v1.1