11 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
1
vote
1
answer
161
views
constexpr function not compiling post gcc 10
I have the following code snippet :
#include <iostream>
// Another function that takes a const char array reference
template <size_t N>
constexpr
int anotherFunction(const char (&...
1
vote
0
answers
183
views
C++ Eigen::inverse function renders totally wrong array with ffast-math option
In Ubuntu18.04, I got issue with eigen library with array inversion function, when compile with -O3 and -ffast-math option, the number in the even number of column have wrong sign for them.
The steps ...
0
votes
1
answer
436
views
Visual C++: cast to function type is illegal, g++ also yields an error
My generated code always used unnecessary many parenthesis simply to make certain, that the C++ code was actually doing what the AST expressed. This is first time I'm getting this compiler error, ...
1
vote
0
answers
59
views
ranges fill does not compile [duplicate]
int n=10;
vector<bool> translated_ancestors(n) ;
std::fill(begin(translated_ancestors), end(translated_ancestors), false);
Compiles with no errors.
But if I change to:
ranges::fill(...
2
votes
2
answers
377
views
template class method specialization using concepts
There is a template class A with template parameter T. I want this class to have a method f if T is of integral types. The class A also has a lot of other methods, so I don't want to have ...
2
votes
0
answers
227
views
Parallel STL algorithms requiring tbb or not?
I remember that g++ 9.3.0 required to link against libtbb to use parallel STL algorithms, otherwise it gave compilation errors. I have a docker container using an ubuntu image where I have installed g+...
1
vote
1
answer
409
views
atomic_wait and similar methods in c++ 20 and g++ 10.2
I am compiling with g++ 10.2 using -std=c++20 but i get errors like error: ‘atomic_notify_one’ is not a member of ‘std’. I see in the docs that those methods are supported in c++20. Do i miss ...
1
vote
1
answer
3k
views
error: no match for call to '(const std::ranges::__sort_fn)
I was practicing vectors and ranges in c++ 20 was stuck at following state.
#include <iostream>
#include <vector>
#include <random>
#include <ranges>
#include <algorithm>
...
3
votes
2
answers
3k
views
error: 'sort' is not a member of 'std::ranges'; did you mean 'std::sort'?
I ran the following code
vector<int> randomIntegers = generateIntegers(10); // Generates 10 integers
std::ranges::sort(randomIntegers);
When I compile with g++ -std=c++20 file.cpp , I get
...
0
votes
0
answers
777
views
GTest Based Test Binary Fails at Build
I am gonna integrate GoogleTest into my project but am facing the some troubles to make my test binary built.
As my code to test is C++20 I need to use g++-10 to build it.
In my root CMakeLists.txt I ...
0
votes
1
answer
300
views
What standard does g++ (10.1) use if none specified?
If --std= is not defined, what C++ standard does g++ 10.1.1 implement?
I couldn't find this in the manual. [Sure it must be somewhere.]