From 433bb11fa99036027bed8b64501c137f71ede20b Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Thu, 12 Feb 2009 02:36:14 -0400 Subject: Moved value_t::set_type into value.cc, since it had grown. --- src/value.cc | 20 ++++++++++++++++++++ src/value.h | 19 +------------------ 2 files changed, 21 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/value.cc b/src/value.cc index a39eada2..e7f726ce 100644 --- a/src/value.cc +++ b/src/value.cc @@ -104,6 +104,26 @@ value_t::operator bool() const return false; } +void value_t::set_type(type_t new_type) +{ + assert(new_type >= VOID && new_type <= POINTER); + if (new_type == VOID) { +#if BOOST_VERSION >= 103700 + storage.reset(); +#else + storage = intrusive_ptr(); +#endif + assert(is_null()); + } else { + if (! storage || storage->refc > 1) + storage = new storage_t; + else + storage->data = false; // destruct all other types + storage->type = new_type; + assert(is_type(new_type)); + } +} + bool value_t::to_boolean() const { if (is_boolean()) { diff --git a/src/value.h b/src/value.h index 02c338f2..e98d74cb 100644 --- a/src/value.h +++ b/src/value.h @@ -459,24 +459,7 @@ public: } private: - void set_type(type_t new_type) { - assert(new_type >= VOID && new_type <= POINTER); - if (new_type == VOID) { -#if BOOST_VERSION >= 103700 - storage.reset(); -#else - storage = intrusive_ptr(); -#endif - assert(is_null()); - } else { - if (! storage || storage->refc > 1) - storage = new storage_t; - else - storage->data = false; // destruct all other types - storage->type = new_type; - assert(is_type(new_type)); - } - } + void set_type(type_t new_type); public: /** -- cgit v1.2.3