alandefreitas / matplotplusplus

Matplot++: A C++ Graphics Library for Data Visualization 📊🗾
https://alandefreitas.github.io/matplotplusplus/
MIT License
4.11k stars 313 forks source link

custom marker errors in line_spec.cpp #298

Open ebalo55 opened 1 year ago

ebalo55 commented 1 year ago

Bug category

Describe the bug

Impossibility to compile library using c++23

Steps to Reproduce

Output

```console /home/ebalo/Desktop/Projects/c++/seo_report_generator/libraries/matplotplusplus/source/matplot/core/line_spec.cpp:76:34: error: no match for ‘operator=’ (operand types are ‘std::string’ {aka ‘std::__cxx11::basic_string’} and ‘const char8_t [4]’) 76 | custom_marker_ = u8"▶"; | ^~~~~ In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from /home/ebalo/Desktop/Projects/c++/seo_report_generator/libraries/matplotplusplus/source/matplot/core/line_spec.cpp:5: /usr/include/c++/11/bits/basic_string.h:799:8: note: candidate: ‘template std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const _Tp&) [with _Tp = _Tp; _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator]’ 799 | operator=(const _Tp& __svt) | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:799:8: note: template argument deduction/substitution failed: In file included from /usr/include/c++/11/bits/move.h:57, from /usr/include/c++/11/bits/nested_exception.h:40, from /usr/include/c++/11/exception:154, from /usr/include/c++/11/ios:39, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from /home/ebalo/Desktop/Projects/c++/seo_report_generator/libraries/matplotplusplus/source/matplot/core/line_spec.cpp:5: /usr/include/c++/11/type_traits: In substitution of ‘template using enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = std::__cxx11::basic_string&]’: /usr/include/c++/11/bits/basic_string.h:125:8: required by substitution of ‘template template using _If_sv = std::enable_if_t >, std::__not_*> >, std::__not_ > >::value, _Res> [with _Tp = char8_t [4]; _Res = std::__cxx11::basic_string&; _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator]’ /usr/include/c++/11/bits/basic_string.h:799:8: required by substitution of ‘template std::__cxx11::basic_string::_If_sv<_Tp, std::__cxx11::basic_string&> std::__cxx11::basic_string::operator=<_Tp>(const _Tp&) [with _Tp = char8_t [4]]’ /home/ebalo/Desktop/Projects/c++/seo_report_generator/libraries/matplotplusplus/source/matplot/core/line_spec.cpp:76:34: required from here /usr/include/c++/11/type_traits:2585:11: error: no type named ‘type’ in ‘struct std::enable_if&>’ 2585 | using enable_if_t = typename enable_if<_Cond, _Tp>::type; | ^~~~~~~~~~~ In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from /home/ebalo/Desktop/Projects/c++/seo_report_generator/libraries/matplotplusplus/source/matplot/core/line_spec.cpp:5: /usr/include/c++/11/bits/basic_string.h:679:7: note: candidate: ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator]’ 679 | operator=(const basic_string& __str) | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:679:37: note: no known conversion for argument 1 from ‘const char8_t [4]’ to ‘const std::__cxx11::basic_string&’ 679 | operator=(const basic_string& __str) | ~~~~~~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/11/bits/basic_string.h:689:7: note: candidate: ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const _CharT*) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator]’ (near match) 689 | operator=(const _CharT* __s) | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:689:7: note: conversion of argument 1 would be ill-formed: /home/ebalo/Desktop/Projects/c++/seo_report_generator/libraries/matplotplusplus/source/matplot/core/line_spec.cpp:76:34: error: invalid conversion from ‘const char8_t*’ to ‘const char*’ [-fpermissive] 76 | custom_marker_ = u8"▶"; | ^~~~~ | | | const char8_t* In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from /home/ebalo/Desktop/Projects/c++/seo_report_generator/libraries/matplotplusplus/source/matplot/core/line_spec.cpp:5: /usr/include/c++/11/bits/basic_string.h:700:7: note: candidate: ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(_CharT) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator]’ (near match) 700 | operator=(_CharT __c) | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:700:7: note: conversion of argument 1 would be ill-formed: /home/ebalo/Desktop/Projects/c++/seo_report_generator/libraries/matplotplusplus/source/matplot/core/line_spec.cpp:76:34: error: invalid conversion from ‘const char8_t*’ to ‘char’ [-fpermissive] 76 | custom_marker_ = u8"▶"; | ^~~~~ | | | const char8_t* In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from /home/ebalo/Desktop/Projects/c++/seo_report_generator/libraries/matplotplusplus/source/matplot/core/line_spec.cpp:5: /usr/include/c++/11/bits/basic_string.h:717:7: note: candidate: ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator]’ 717 | operator=(basic_string&& __str) | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:717:32: note: no known conversion for argument 1 from ‘const char8_t [4]’ to ‘std::__cxx11::basic_string&&’ 717 | operator=(basic_string&& __str) | ~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/11/bits/basic_string.h:785:7: note: candidate: ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(std::initializer_list<_Tp>) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator]’ 785 | operator=(initializer_list<_CharT> __l) | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:785:42: note: no known conversion for argument 1 from ‘const char8_t [4]’ to ‘std::initializer_list’ 785 | operator=(initializer_list<_CharT> __l) | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~ /home/ebalo/Desktop/Projects/c++/seo_report_generator/libraries/matplotplusplus/source/matplot/core/line_spec.cpp:80:34: error: no match for ‘operator=’ (operand types are ‘std::string’ {aka ‘std::__cxx11::basic_string’} and ‘const char8_t [4]’) 80 | custom_marker_ = u8"◀"; | ^~~~~ In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from /home/ebalo/Desktop/Projects/c++/seo_report_generator/libraries/matplotplusplus/source/matplot/core/line_spec.cpp:5: /usr/include/c++/11/bits/basic_string.h:799:8: note: candidate: ‘template std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const _Tp&) [with _Tp = _Tp; _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator]’ 799 | operator=(const _Tp& __svt) | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:799:8: note: template argument deduction/substitution failed: /usr/include/c++/11/bits/basic_string.h:679:7: note: candidate: ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator]’ 679 | operator=(const basic_string& __str) | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:679:37: note: no known conversion for argument 1 from ‘const char8_t [4]’ to ‘const std::__cxx11::basic_string&’ 679 | operator=(const basic_string& __str) | ~~~~~~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/11/bits/basic_string.h:689:7: note: candidate: ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const _CharT*) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator]’ (near match) 689 | operator=(const _CharT* __s) | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:689:7: note: conversion of argument 1 would be ill-formed: /home/ebalo/Desktop/Projects/c++/seo_report_generator/libraries/matplotplusplus/source/matplot/core/line_spec.cpp:80:34: error: invalid conversion from ‘const char8_t*’ to ‘const char*’ [-fpermissive] 80 | custom_marker_ = u8"◀"; | ^~~~~ | | | const char8_t* In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from /home/ebalo/Desktop/Projects/c++/seo_report_generator/libraries/matplotplusplus/source/matplot/core/line_spec.cpp:5: /usr/include/c++/11/bits/basic_string.h:700:7: note: candidate: ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(_CharT) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator]’ (near match) 700 | operator=(_CharT __c) | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:700:7: note: conversion of argument 1 would be ill-formed: /home/ebalo/Desktop/Projects/c++/seo_report_generator/libraries/matplotplusplus/source/matplot/core/line_spec.cpp:80:34: error: invalid conversion from ‘const char8_t*’ to ‘char’ [-fpermissive] 80 | custom_marker_ = u8"◀"; | ^~~~~ | | | const char8_t* In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from /home/ebalo/Desktop/Projects/c++/seo_report_generator/libraries/matplotplusplus/source/matplot/core/line_spec.cpp:5: /usr/include/c++/11/bits/basic_string.h:717:7: note: candidate: ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator]’ 717 | operator=(basic_string&& __str) | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:717:32: note: no known conversion for argument 1 from ‘const char8_t [4]’ to ‘std::__cxx11::basic_string&&’ 717 | operator=(basic_string&& __str) | ~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/11/bits/basic_string.h:785:7: note: candidate: ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(std::initializer_list<_Tp>) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator]’ 785 | operator=(initializer_list<_CharT> __l) | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:785:42: note: no known conversion for argument 1 from ‘const char8_t [4]’ to ‘std::initializer_list’ 785 | operator=(initializer_list<_CharT> __l) | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~ /home/ebalo/Desktop/Projects/c++/seo_report_generator/libraries/matplotplusplus/source/matplot/core/line_spec.cpp: In member function ‘void matplot::line_spec::marker_style(std::string_view)’: /home/ebalo/Desktop/Projects/c++/seo_report_generator/libraries/matplotplusplus/source/matplot/core/line_spec.cpp:392:30: error: no match for ‘operator=’ (operand types are ‘std::string’ {aka ‘std::__cxx11::basic_string’} and ‘const char8_t [4]’) 392 | custom_marker_ = u8"▶"; | ^~~~~ In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from /home/ebalo/Desktop/Projects/c++/seo_report_generator/libraries/matplotplusplus/source/matplot/core/line_spec.cpp:5: /usr/include/c++/11/bits/basic_string.h:799:8: note: candidate: ‘template std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const _Tp&) [with _Tp = _Tp; _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator]’ 799 | operator=(const _Tp& __svt) | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:799:8: note: template argument deduction/substitution failed: /usr/include/c++/11/bits/basic_string.h:679:7: note: candidate: ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator]’ 679 | operator=(const basic_string& __str) | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:679:37: note: no known conversion for argument 1 from ‘const char8_t [4]’ to ‘const std::__cxx11::basic_string&’ 679 | operator=(const basic_string& __str) | ~~~~~~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/11/bits/basic_string.h:689:7: note: candidate: ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const _CharT*) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator]’ (near match) 689 | operator=(const _CharT* __s) | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:689:7: note: conversion of argument 1 would be ill-formed: /home/ebalo/Desktop/Projects/c++/seo_report_generator/libraries/matplotplusplus/source/matplot/core/line_spec.cpp:392:30: error: invalid conversion from ‘const char8_t*’ to ‘const char*’ [-fpermissive] 392 | custom_marker_ = u8"▶"; | ^~~~~ | | | const char8_t* In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from /home/ebalo/Desktop/Projects/c++/seo_report_generator/libraries/matplotplusplus/source/matplot/core/line_spec.cpp:5: /usr/include/c++/11/bits/basic_string.h:700:7: note: candidate: ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(_CharT) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator]’ (near match) 700 | operator=(_CharT __c) | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:700:7: note: conversion of argument 1 would be ill-formed: /home/ebalo/Desktop/Projects/c++/seo_report_generator/libraries/matplotplusplus/source/matplot/core/line_spec.cpp:392:30: error: invalid conversion from ‘const char8_t*’ to ‘char’ [-fpermissive] 392 | custom_marker_ = u8"▶"; | ^~~~~ | | | const char8_t* In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from /home/ebalo/Desktop/Projects/c++/seo_report_generator/libraries/matplotplusplus/source/matplot/core/line_spec.cpp:5: /usr/include/c++/11/bits/basic_string.h:717:7: note: candidate: ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator]’ 717 | operator=(basic_string&& __str) | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:717:32: note: no known conversion for argument 1 from ‘const char8_t [4]’ to ‘std::__cxx11::basic_string&&’ 717 | operator=(basic_string&& __str) | ~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/11/bits/basic_string.h:785:7: note: candidate: ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(std::initializer_list<_Tp>) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator]’ 785 | operator=(initializer_list<_CharT> __l) | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:785:42: note: no known conversion for argument 1 from ‘const char8_t [4]’ to ‘std::initializer_list’ 785 | operator=(initializer_list<_CharT> __l) | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~ /home/ebalo/Desktop/Projects/c++/seo_report_generator/libraries/matplotplusplus/source/matplot/core/line_spec.cpp:396:30: error: no match for ‘operator=’ (operand types are ‘std::string’ {aka ‘std::__cxx11::basic_string’} and ‘const char8_t [4]’) 396 | custom_marker_ = u8"◀"; | ^~~~~ In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from /home/ebalo/Desktop/Projects/c++/seo_report_generator/libraries/matplotplusplus/source/matplot/core/line_spec.cpp:5: /usr/include/c++/11/bits/basic_string.h:799:8: note: candidate: ‘template std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const _Tp&) [with _Tp = _Tp; _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator]’ 799 | operator=(const _Tp& __svt) | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:799:8: note: template argument deduction/substitution failed: /usr/include/c++/11/bits/basic_string.h:679:7: note: candidate: ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator]’ 679 | operator=(const basic_string& __str) | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:679:37: note: no known conversion for argument 1 from ‘const char8_t [4]’ to ‘const std::__cxx11::basic_string&’ 679 | operator=(const basic_string& __str) | ~~~~~~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/11/bits/basic_string.h:689:7: note: candidate: ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const _CharT*) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator]’ (near match) 689 | operator=(const _CharT* __s) | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:689:7: note: conversion of argument 1 would be ill-formed: /home/ebalo/Desktop/Projects/c++/seo_report_generator/libraries/matplotplusplus/source/matplot/core/line_spec.cpp:396:30: error: invalid conversion from ‘const char8_t*’ to ‘const char*’ [-fpermissive] 396 | custom_marker_ = u8"◀"; | ^~~~~ | | | const char8_t* In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from /home/ebalo/Desktop/Projects/c++/seo_report_generator/libraries/matplotplusplus/source/matplot/core/line_spec.cpp:5: /usr/include/c++/11/bits/basic_string.h:700:7: note: candidate: ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(_CharT) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator]’ (near match) 700 | operator=(_CharT __c) | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:700:7: note: conversion of argument 1 would be ill-formed: /home/ebalo/Desktop/Projects/c++/seo_report_generator/libraries/matplotplusplus/source/matplot/core/line_spec.cpp:396:30: error: invalid conversion from ‘const char8_t*’ to ‘char’ [-fpermissive] 396 | custom_marker_ = u8"◀"; | ^~~~~ | | | const char8_t* In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from /home/ebalo/Desktop/Projects/c++/seo_report_generator/libraries/matplotplusplus/source/matplot/core/line_spec.cpp:5: /usr/include/c++/11/bits/basic_string.h:717:7: note: candidate: ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator]’ 717 | operator=(basic_string&& __str) | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:717:32: note: no known conversion for argument 1 from ‘const char8_t [4]’ to ‘std::__cxx11::basic_string&&’ 717 | operator=(basic_string&& __str) | ~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/11/bits/basic_string.h:785:7: note: candidate: ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(std::initializer_list<_Tp>) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator]’ 785 | operator=(initializer_list<_CharT> __l) | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:785:42: note: no known conversion for argument 1 from ‘const char8_t [4]’ to ‘std::initializer_list’ 785 | operator=(initializer_list<_CharT> __l) ```

Platform

Environment Details:

Additional context

ebalo55 commented 1 year ago

A feasible fix will be removing the type u8 before each of the strings at lines 76, 80, 392 and 396. If welcome I'll make a PR.

alandefreitas commented 1 year ago

Yes. They're different types. u8/char8_t is unsigned and a different opaque type. It didn't even exist when this library was written. I'm not about the best conventions to support char8_t throughout the library yet.