2
0
mirror of https://github.com/boostorg/pfr.git synced 2026-01-19 04:22:13 +00:00

Forbid get_name for arrays

This commit is contained in:
denzor200
2023-09-23 01:53:00 +03:00
parent 833f32960a
commit 53fcd78d4f
3 changed files with 42 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
// Copyright (c) 2023 Bela Schaum, X-Ryl669, Denis Mikhailov.
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// Initial implementation by Bela Schaum, https://github.com/schaumb
// The way to make it union and UB free by X-Ryl669, https://github.com/X-Ryl669
//
#include <boost/pfr/core_name.hpp>
int main() {
(void)boost::pfr::get_name<0, int[10]>(); // Must be a compile time error
}

View File

@@ -0,0 +1,17 @@
// Copyright (c) 2023 Bela Schaum, X-Ryl669, Denis Mikhailov.
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// Initial implementation by Bela Schaum, https://github.com/schaumb
// The way to make it union and UB free by X-Ryl669, https://github.com/X-Ryl669
//
#include <boost/pfr/core_name.hpp>
int main() {
(void)boost::pfr::names_as_array<int[10]>(); // Must be a compile time error
}