Skip to content

Use __declspec(empty_bases) on MSVC #60

Description

@marzer

Hiya,

For legacy/backcompat reasons MSVC doesn't automatically perform empty-base optimization, and requires you to opt-in using the empty_bases declspec.

This means the following code fails to compile on MSVC (but passes on GCC and Clang):

#include <strong_type/strong_type.hpp>

using myint = strong::type<int, struct my_int_>;

static_assert(sizeof(myint) == sizeof(int));

I have a patch to fix this locally, would you like it contributed as a PR? Edit: #61

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions