From 134fe467c5ac962b909d1c6848fd7d5aae87c93e Mon Sep 17 00:00:00 2001 From: Daniel Larimer Date: Tue, 9 Jul 2013 21:06:23 -0400 Subject: [PATCH] bug fixes and adding missing files --- include/fc/network/resolve.hpp | 8 ++++++++ include/fc/optional.hpp | 8 +++++++- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 include/fc/network/resolve.hpp diff --git a/include/fc/network/resolve.hpp b/include/fc/network/resolve.hpp new file mode 100644 index 0000000..44b09c8 --- /dev/null +++ b/include/fc/network/resolve.hpp @@ -0,0 +1,8 @@ +#pragma once +#include +#include + +namespace fc +{ + fc::vector resolve( const fc::string& host, uint16_t port ); +} diff --git a/include/fc/optional.hpp b/include/fc/optional.hpp index 47fc457..273734c 100644 --- a/include/fc/optional.hpp +++ b/include/fc/optional.hpp @@ -108,7 +108,12 @@ namespace fc { return ptr(); } - private: + optional& operator=(std::nullptr_t) + { + reset(); + return *this; + } + void reset() { if( _valid ) @@ -117,6 +122,7 @@ namespace fc { } _valid = false; } + private: T& ref() { return *ptr(); } const T& ref()const { return *ptr(); } T* ptr() { void* v = &_value[0]; return static_cast(v); }