Created
January 20, 2020 16:48
-
-
Save vinniefalco/eb60c5f365fd100fa41ad36458f639be to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace url { | |
class basic_value | |
{ | |
char* s_; | |
public: | |
// construct a URL from a string. | |
// the string is copied. | |
basic_value( string_view s ); | |
// return the hostname | |
string_view | |
encoded_hostname() const noexcept; | |
protected: | |
virtual | |
char* | |
reserve( | |
char* buffer, | |
std::size_t n) = 0; | |
}; | |
template<class Allocator> | |
class dynamic_value : public basic_value | |
{ | |
Allocator a_; | |
... | |
}; | |
template<std::size_t N> | |
class static_value : public basic_value | |
{ | |
char buf_[N+1]; // for the null | |
}; | |
using value = dynamic_value<std::allocator<char>>; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment