Этот код не компилируется с GCC14 с -std = c ++ 20 .
#include
#include
struct Foo
{
template
Foo(T) {}
};
struct Bar
{
Bar(std::tuple) {}
};
int main()
{
return std::is_constructible_v;
}
< /code>
Ошибки включают < /p>
tuple:979:42: error: satisfaction of atomic constraint '__constructible() [with _Elements = {_Elements ...}; _UTypes = {_UTypes ...}]' depends on itself
tuple:989:42: error: 'static consteval bool std::tuple< >::__constructible() [with _UTypes = {Bar}; _Elements = {Foo}]' called in a constant expression before its definition is complete
tuple:989:42: error: satisfaction value of atomic constraint '__constructible() [with _Elements = {Foo}; _UTypes = {Bar}]' changed from '' to 'true'
Полный вывод можно увидеть здесь: https://godbolt.org/z/qfc3p7rqf
образное. Размещение явного в bar конструктор также решает проблему. PrettyPrint-Override ">Bar b1{Foo{0}};
Bar b2{b1};
Подробнее здесь: https://stackoverflow.com/questions/795 ... -on-itself
Удовлетворение атомного ограничения '__ -конструктивного ... »зависит от себя ⇐ C++
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Какова правильная и оптимальная реализация атомного_ref и атомного с битами заполнения?
Anonymous » » в форуме C++ - 0 Ответы
- 64 Просмотры
-
Последнее сообщение Anonymous
-