python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
New-expression with consteval constructor in constexpr context
struct A {
consteval A() {};
};
constexpr bool g() {
auto a = new A;
delete a;
return true;
}
int main() {
static_assert(g());
}
https://godbolt.org/z/jsq35WxKs
GCC and M...
user17732522
Votes: 0
Answers: 1
Can a class with consteval constructor be created on heap in C++?
In the following code struct A has immediate function default constructor, and an object of the struct is created in the dynamic memory be means of new A{}:
struct A {
consteval A() {}
};
...
Fedor
Votes: 0
Answers: 1
non-'constexpr' function std::to_string(int) in a consteval lambda
I'm having trouble with std::to_string() in the following lambda function:
#include <iostream>
#include <string>
inline constexpr int a_global_constant { 12345 };
int main( )
{
aut...
digito_evo
Votes: 0
Answers: 1
Non-literal types and constant expressions
struct A {
~A() {}
consteval A() {}
consteval auto f() {}
};
int main() {
A{};
//A{}.f(); //1
}
https://godbolt.org/z/4KPY5P7o7
This program is accepted by ICC, GCC and Cl...
user17732522
Votes: 0
Answers: 1