bug fixes and adding missing files
This commit is contained in:
parent
fbcdd4fa5e
commit
134fe467c5
2 changed files with 15 additions and 1 deletions
8
include/fc/network/resolve.hpp
Normal file
8
include/fc/network/resolve.hpp
Normal 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 );
|
||||
}
|
||||
|
|
@ -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<T*>(v); }
|
||||
|
|
|
|||
Loading…
Reference in a new issue