Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
StefanS52u1 opened this issue Jul 16, 2024 · 0 comments

Comments

@StefanS52u1
Copy link

StefanS52u1 commented Jul 16, 2024

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>();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant