summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-12 02:36:14 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-12 02:36:14 -0400
commit433bb11fa99036027bed8b64501c137f71ede20b (patch)
tree10a5cdb8265730d3e2d16f7b88199c6900ccdcb5 /src
parent9344598eb04fb40947b132fd06468d98d737eb07 (diff)
downloadfork-ledger-433bb11fa99036027bed8b64501c137f71ede20b.tar.gz
fork-ledger-433bb11fa99036027bed8b64501c137f71ede20b.tar.bz2
fork-ledger-433bb11fa99036027bed8b64501c137f71ede20b.zip
Moved value_t::set_type into value.cc, since it had grown.
Diffstat (limited to 'src')
-rw-r--r--src/value.cc20
-rw-r--r--src/value.h19
2 files changed, 21 insertions, 18 deletions
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<storage_t>();
+#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<storage_t>();
-#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:
/**