Questions tagged [isocpp]
6 questions
16
votes
1 answer
Why is there still no range-enabled reduction algorithm in std?
The only options available are std::ranges::for_each and simple range-based for loop. No counterparts for std::accumulate, std::reduce or std::inner_product. std::ranges::reduce would be enough, if it were present; inner product can be achieved…

Red.Wave
- 2,790
- 11
- 17
2
votes
1 answer
Is placement new on a const variable with automatic storage duration legal?
Is the following code legal according to the standard?
#include
int main() {
const int x = 3;
new ((void *)&x) int { 15 };
}
It seems to me that as long as there is no use of a reference to x it should be valid.
As per the c++…

Dorian
- 490
- 2
- 10
2
votes
2 answers
Pointer to const object as a data member
Accordingly to C++ best practices on IsoCpp we shouldn't have a const or reference data member: C.12: Don’t make data members const or references
But it does not specify if a pointer to a const object is allowed or not. Consider the example:
class…

Vinícius Ferrão
- 657
- 7
- 17
1
vote
0 answers
Why is there still no move-from-elements ctor for `std::tuple'?
Long while ago I faced a question very much like this one:
std::tuple default constructor with move-constructable element
C++ is evolving and improving at a high rate, but minor changes to code still bite a programmers toes. I tested adding a SFINAE…

Red.Wave
- 2,790
- 11
- 17
0
votes
0 answers
multiclass robust svm using cvxopt socp
we have binary class robust svm https://cvxopt.org/examples/mlbook/robsvm.html. Similar to this, is there any reference for multiclass robust svm for the same using socp here?

Sree
- 61
- 2
0
votes
0 answers
ISO C++ Standardisation of offset_ptr
Boost provides a relative offset pointer (boost::interprocess::offset_ptr) which can be used in place of regular of a raw pointer in STL containers with an appropriate allocator (see this question for one reason why this is useful).
A concise…

Bruce Adams
- 4,953
- 4
- 48
- 111