[pan] fix (string-view): compilation with clang on Mac



commit ccd1197137b22e1bd49273f6e025d8ed3d13a0c8
Author: Dominique Dumont <dod debian org>
Date:   Mon Dec 27 12:38:04 2021 +0100

    fix (string-view): compilation with clang on Mac
    
    Closes: #136
    
    This patch changes the automatic conversion from String::View to a
    string.
    
    StringView is converted to a plain std::string and not a const
    std::string.
    
    Looks like clang is more picky regarding conversion target type.
    
    For more information of conversion type, see 
https://docs.microsoft.com/en-us/cpp/cpp/user-defined-type-conversions-cpp

 pan/general/string-view.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/pan/general/string-view.h b/pan/general/string-view.h
index 4a3befd..06e24f6 100644
--- a/pan/general/string-view.h
+++ b/pan/general/string-view.h
@@ -95,7 +95,7 @@ namespace pan
          std::string to_string () const {return empty()
                                          ? std::string()
                                          : std::string(str,str+len); }
-         operator const std::string () const { return to_string(); }
+         operator std::string () const { return to_string(); }
 
          StringView substr (const char * start, const char * end) const;
          void substr (const char * start, const char * end, StringView& setme) const;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]