Skip to content

Commit

Permalink
TextView: switch to enable_if_t
Browse files Browse the repository at this point in the history
  • Loading branch information
SolidWallOfCode committed Mar 4, 2022
1 parent bdd4955 commit 3ba4117
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions code/include/swoc/TextView.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ class TextView : public std::string_view {
* to @c char @c const @c * and @c size_t respectively.
*/
template < typename C
, typename = typename std::enable_if<
, typename = std::enable_if_t<
std::is_convertible_v<decltype(std::declval<C>().data()), char const*> &&
std::is_convertible_v<decltype(std::declval<C>().size()), size_t>
, void
>::type
>
> constexpr TextView(C const& c);

/** Construct from literal string or array.
Expand Down Expand Up @@ -180,7 +180,7 @@ class TextView : public std::string_view {
/// Explicitly set the view from a @c std::string
self_type &assign(std::string const &s);

/** Assogm from any character container following STL standards.
/** Assign from any character container following STL standards.
*
* @tparam C Container type.
* @param c container
Expand All @@ -189,11 +189,11 @@ class TextView : public std::string_view {
* to @c char @c const @c * and @c size_t respectively.
*/
template < typename C
, typename = typename std::enable_if<
, typename = std::enable_if_t<
std::is_convertible_v<decltype(std::declval<C>().data()), char const*> &&
std::is_convertible_v<decltype(std::declval<C>().size()), size_t>
, void
>::type
>
> constexpr self_type & assign(C const& c) {
return this->assign(c.data(), c.size());
}
Expand Down

0 comments on commit 3ba4117

Please sign in to comment.