diff options
author | John Hodge <tpg@mutabah.net> | 2016-05-18 13:53:56 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-05-18 13:53:56 +0800 |
commit | 2983a5f8a6b08acc34413a85f7e554ec7ceaad2d (patch) | |
tree | e6037516690d64cebdebaf33071da359349fb96d /src/include/rustic.hpp | |
parent | 8f1a4e56874b0321081161aedfa4da768ffcc65e (diff) | |
download | mrust-2983a5f8a6b08acc34413a85f7e554ec7ceaad2d.tar.gz |
Enable full optimisation (and fix compiler errors from that)
Diffstat (limited to 'src/include/rustic.hpp')
-rw-r--r-- | src/include/rustic.hpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/include/rustic.hpp b/src/include/rustic.hpp index 3b4a0386..5d768152 100644 --- a/src/include/rustic.hpp +++ b/src/include/rustic.hpp @@ -73,6 +73,9 @@ class option { char m_data[ sizeof(T) ]; bool m_set; + + void* data_ptr() { return m_data; } + const void* data_ptr() const { return m_data; } public: option(T ent): m_set(true) @@ -84,7 +87,7 @@ public: {} ~option() { if( m_set ) { - reinterpret_cast<T*>(m_data)->~T(); + reinterpret_cast<T*>(data_ptr())->~T(); } } |