diff options
author | Kjell Ahlstedt <kjellahlstedt@gmail.com> | 2022-02-15 13:01:36 +0100 |
---|---|---|
committer | Kjell Ahlstedt <kjellahlstedt@gmail.com> | 2022-02-15 13:01:36 +0100 |
commit | 7b811a0be824675f31a422d40a75bbb5d10e32ad (patch) | |
tree | 2e50a9adb9fe52647937e999fecf6658b0ebc7f9 /glib/glibmm | |
parent | 9c0b7ab4269fa619deb78cf16875eab851c6b2ec (diff) | |
download | glibmm-7b811a0be824675f31a422d40a75bbb5d10e32ad.tar.gz |
ustring_Iterator: Declare the copy constructor =default
Avoid warnings from the clang++ compiler.
It's deprecated to implicitly declare a copy constructor, if there
is a user-defined copy assignment operator.
Diffstat (limited to 'glib/glibmm')
-rw-r--r-- | glib/glibmm/ustring.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/glib/glibmm/ustring.h b/glib/glibmm/ustring.h index 41165f58..594a2f29 100644 --- a/glib/glibmm/ustring.h +++ b/glib/glibmm/ustring.h @@ -198,7 +198,14 @@ public: using pointer = void; inline ustring_Iterator(); - inline ustring_Iterator(const ustring_Iterator<std::string::iterator>& other); + // A std::string::iterator can be copied to a std::string::const_iterator. + template <typename T2, typename = typename std::enable_if< + std::is_same<std::string::const_iterator, T>::value && + std::is_same<std::string::iterator, T2>::value, T2>::type> + inline ustring_Iterator(const ustring_Iterator<T2>& other) + : pos_(other.base()) + { } + ustring_Iterator(const ustring_Iterator& other) = default; ustring_Iterator& operator=(const ustring_Iterator& other) = default; inline value_type operator*() const; @@ -1067,12 +1074,6 @@ inline ustring_Iterator<T>::ustring_Iterator() : pos_() } template <class T> -inline ustring_Iterator<T>::ustring_Iterator(const ustring_Iterator<std::string::iterator>& other) -: pos_(other.base()) -{ -} - -template <class T> inline typename ustring_Iterator<T>::value_type ustring_Iterator<T>::operator*() const { return Glib::get_unichar_from_std_iterator(pos_); |