Dobiasd / FunctionalPlus

Functional Programming Library for C++. Write concise and readable C++ code.
http://www.editgym.com/fplus-api-search/
Boost Software License 1.0
2.06k stars 167 forks source link

gcc-14 warning #308

Closed fangzhou-xie closed 21 hours ago

fangzhou-xie commented 4 days ago

Thanks for the wonderful library.

I have an R package (rethnicity) that relies on frugally-deep (and hence fplus). I recently got an warning in the compilation that is related to the change in standard (since gcc-14) and wonder what would be the best way to get rid of this warning (warning: template-id not allowed for constructor in C++20).

The warning seems to suggest that it is the struct array_back_insert_iterator that has this issue.

References:

  1. C++ and ISO C++ 2017
  2. simdjson
  3. rcppsimdjson

Thanks!

Dobiasd commented 3 days ago

Thanks for the nice feedback!

I'll try to fix it and will get back to you.

Dobiasd commented 3 days ago

Do you have a minimal example to reproduce the problem?

I tried like this

#include <fplus/fplus.hpp>
#include <iostream>
int main()
{
    std::cout << fplus::show(42) << std::endl;
}
g++ -std=c++20 -Wall -Wextra -pedantic -Wshadow -Werror -Weffc++ -Wconversion -Wsign-conversion -Wctor-dtor-privacy -Wreorder -Wold-style-cast -Wparentheses main.cpp

but don't get the warnings.

Is this the wrong g++ version?

g++ --version
g++ (GCC) 14.1.1 20240701 (Red Hat 14.1.1-7)
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
fangzhou-xie commented 21 hours ago

Thank you very much for your reply! I double-checked and it seems I was using an old version of "fplus.hpp" which has the issue. After updating my code base using the latest version, the issue goes away. I think my issue was related to earlier issues regarding C++20 error in compilation.

Closing the issue because it is solved. Thank you for your help and sorry for the confusion.

Dobiasd commented 21 hours ago

Ah, cool! I'm glad it's resolved.

Maybe it was fixed back then by this commit.