axiomatic-systems / Bento4

Full-featured MP4 format, MPEG DASH, HLS, CMAF SDK and tools
http://www.bento4.com
2.03k stars 483 forks source link

C++ 20 support ? #954

Open alexbuisson opened 7 months ago

alexbuisson commented 7 months ago

Is there a way to build with C++ 20 or do you have an update plan for that ? template class like AP4_List and Array are not compile as is with C++20 standard.

barbibulle commented 7 months ago

I’ll take a look.

alexbuisson commented 7 months ago

just add set(CMAKE_CXX_STANDARD 20) in CMakeLists.txt and build

gcc version 11.2.1 20220127 (Red Hat 11.2.1-9) (GCC)

using C++20 it seems that using the notation in the definition is consider as an error c++20-quick-fix.patch

I think it's a minimal patch tested with gc11 + vs2022 with C++ standard 11, 17 and 20 I'm a bit surprise that it didn't complain about

AP4_Array& operator=(const AP4_Array& copy); and AP4_List& operator=(const AP4_List&);

maybe those operator aren't really used so it doesn't trigger a compilation error !

barbibulle commented 6 months ago

The latest code should support C++ 20 with gcc now. Please let me know if that works for you.