最終更新日時(UTC):
が更新

履歴 編集

function
<meta>

std::meta::is_layout_compatible_type(C++26)

namespace std::meta {
  consteval bool is_layout_compatible_type(info type1, info type2);
}

概要

2つの型がレイアウト互換かを判定する。std::is_layout_compatibleに対応する。

戻り値

type1type2がレイアウト互換である場合にtrueを返す。

例外

type1またはtype2が型を表さない場合、std::meta::exception例外を送出する。

#include <meta>

struct A { int x; };
struct B { int y; };

int main() {
  static_assert(std::meta::is_layout_compatible_type(^^A, ^^B));
}

出力

バージョン

言語

  • C++26

処理系

関連項目

参照