bug fixes and adding missing files

This commit is contained in:
Daniel Larimer 2013-07-09 21:06:23 -04:00
parent fbcdd4fa5e
commit 134fe467c5
2 changed files with 15 additions and 1 deletions

View file

@ -0,0 +1,8 @@
#pragma once
#include <fc/vector.hpp>
#include <fc/network/ip.hpp>
namespace fc
{
fc::vector<fc::ip::endpoint> resolve( const fc::string& host, uint16_t port );
}

View file

@ -108,7 +108,12 @@ namespace fc {
return ptr(); return ptr();
} }
private: optional& operator=(std::nullptr_t)
{
reset();
return *this;
}
void reset() void reset()
{ {
if( _valid ) if( _valid )
@ -117,6 +122,7 @@ namespace fc {
} }
_valid = false; _valid = false;
} }
private:
T& ref() { return *ptr(); } T& ref() { return *ptr(); }
const T& ref()const { return *ptr(); } const T& ref()const { return *ptr(); }
T* ptr() { void* v = &_value[0]; return static_cast<T*>(v); } T* ptr() { void* v = &_value[0]; return static_cast<T*>(v); }