From 2983a5f8a6b08acc34413a85f7e554ec7ceaad2d Mon Sep 17 00:00:00 2001 From: John Hodge Date: Wed, 18 May 2016 13:53:56 +0800 Subject: Enable full optimisation (and fix compiler errors from that) --- src/include/rustic.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/include/rustic.hpp') 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(m_data)->~T(); + reinterpret_cast(data_ptr())->~T(); } } -- cgit v1.2.3