Add c_str function to strings. Mainly just an aesthetic change for me

This commit is contained in:
rexy712 2020-07-17 14:39:06 -07:00
parent 03e81c0457
commit 8c783c48fa
2 changed files with 8 additions and 0 deletions

View File

@ -105,6 +105,12 @@ namespace rexy::cx{
constexpr size_t capacity(void)const noexcept{
return max_size;
}
constexpr char* c_str(void)noexcept{
return m_data;
}
constexpr const char* c_str(void)const noexcept{
return m_data;
}
constexpr char* get(void)noexcept{
return m_data;
}

View File

@ -61,6 +61,8 @@ namespace rexy{
constexpr size_t length(void)const noexcept{return m_length;}
constexpr size_t capacity(void)const noexcept{return m_cap;}
//direct access to managed pointer
constexpr char* c_str(void)noexcept{return m_data;}
constexpr const char* c_str(void)const noexcept{return m_data;}
constexpr char* get(void)noexcept{return m_data;}
constexpr const char* get(void)const noexcept{return m_data;}
constexpr operator char*(void)noexcept{return m_data;}