Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++ 20 support ? #954

Open
alexbuisson opened this issue Apr 17, 2024 · 3 comments
Open

C++ 20 support ? #954

alexbuisson opened this issue Apr 17, 2024 · 3 comments

Comments

@alexbuisson
Copy link

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
Copy link
Contributor

I’ll take a look.

@alexbuisson
Copy link
Author

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)

  • error: expected unqualified-id before ‘)’ token AP4_List(): m_ItemCount(0), m_Head(0), m_Tail(0) {}
  • error: template-id not allowed for destructor virtual ~AP4_List()
  • error: expected unqualified-id before ‘const’ AP4_List(const AP4_List&);
    etc ...

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
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants