boostorg / pfr

std::tuple like methods for user defined types without any macro or boilerplate code
https://boost.org/libs/pfr
Boost Software License 1.0
1.34k stars 161 forks source link

boost::pfr::get_name fails if a structurehas a member with a void pointer type #173

Open StefanS52u1 opened 4 months ago

StefanS52u1 commented 4 months ago

VS2022 does not compile the following code snippet , if any member is a void pointer. Are there any workaround?. I did not check, this behavior with clang or gcc.

BOOST 1.84 VS 17.10.3

Example:

include "stdafx.h"

include <boost/pfr/core.hpp>

include <boost/pfr/core_name.hpp>

include <boost/pfr/traits.hpp>

struct LongPointerTest { long* OwningThread; };

struct VoidPointerTestFailsToCompile { void* OwningThread; };

int main() { static_assert(boost::pfr::get_name<0, LongPointerTest>() == "OwningThread"); auto name = boost::pfr::get_name<0, VoidPointerTestFailsToCompile>(); }