Skip to content

Commit

Permalink
[Change] Forbid r-value string instance as ctor parameter of `bux::C_…
Browse files Browse the repository at this point in the history
…IMemStreamT<>`
  • Loading branch information
buck-yeh committed Jun 15, 2022
1 parent 97337fc commit b046518
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/bux/MemIn.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ struct C_IMemBufAsMember
// Ctor
C_IMemBufAsMember(const _CharT *buffer, size_t size): m_Buffer(buffer, size) {}
C_IMemBufAsMember(std::basic_string_view<_CharT,_Traits> buffer): m_Buffer(buffer) {}
C_IMemBufAsMember(std::basic_string<_CharT,_Traits> &&) = delete;
};

template <class _CharT, class _Traits = std::char_traits<_CharT>>
Expand All @@ -47,6 +48,10 @@ class C_IMemStreamT:
C_IMemBufAsMember<_CharT,_Traits>(buffer),
std::basic_istream<_CharT,_Traits>(&this->m_Buffer)
{}
C_IMemStreamT(const _CharT *str):
C_IMemStreamT(std::basic_string_view<_CharT,_Traits>{str})
{}
C_IMemStreamT(std::basic_string<_CharT,_Traits> &&) = delete;
};
using C_IMemStream = C_IMemStreamT<char>;

Expand Down

0 comments on commit b046518

Please sign in to comment.