From a5401241a1976e6a3b102f1b70e5af66c7f205fb Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 28 Mar 2016 10:11:23 -0700 Subject: 2818 --- 033exclusive_container.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '033exclusive_container.cc') diff --git a/033exclusive_container.cc b/033exclusive_container.cc index 5c1fe6ad..2a006a99 100644 --- a/033exclusive_container.cc +++ b/033exclusive_container.cc @@ -8,7 +8,7 @@ //: We'll use this container as a running example, with two number elements. { type_ordinal tmp = put(Type_ordinal, "number-or-point", Next_type_ordinal++); -get_or_insert(Type, tmp).size = 2; +get_or_insert(Type, tmp); // initialize get(Type, tmp).kind = EXCLUSIVE_CONTAINER; get(Type, tmp).name = "number-or-point"; get(Type, tmp).elements.push_back(reagent("i:number")); @@ -35,7 +35,7 @@ if (t.kind == EXCLUSIVE_CONTAINER) { // size of an exclusive container is the size of its largest variant // (So like containers, it can't contain arrays.) int result = 0; - for (int i = 0; i < t.size; ++i) { + for (int i = 0; i < SIZE(t.elements); ++i) { reagent tmp; tmp.type = new type_tree(*type); int size = size_of(variant_type(tmp, i)); -- cgit 1.4.1-2-gfad0