Skip to content

MSVC errors when importing both fmt and std modules #3921

Description

@matt77hias

MSVC has an open bug that prevents a.o. importing both fmt and std modules in some use cases (i.e. depends which functionality one uses from the std) due to the mixing of std includes inside fmt itself and using import std.

For example:

error C2572: 'std::enable_if': redefinition of default argument: parameter 1

It is possible to work around this by replacing std includes inside fmt with import std instead, and including the C headers for the few types and functions defined outside the std namespace (because these are not exported from the std module):

#include <limits.h>
#include <stdint.h>
#include <stdio.h>
#include <time.h>

Maybe something worth considering with an optional feature macro?

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

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions