Skip to content

Duplicated named arguments are ignored, but not rejected #4282

Description

@lewkok

Hi,
Is example like:

#include <fmt/format.h>

int main() {
  using namespace fmt::literals;
  fmt::print("{abc} {1}", "abc"_a = 42, "abc"_a = 43 );
}

This prints: "42 43"

Or this example:

#include <fmt/format.h>

int main() {
  using namespace fmt::literals;
  fmt::print("{abc}", "abc"_a = 42, "abc"_a = 43 );
}

This prints: "42"

Is this semantics like this by design or did it happen by mistake?

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions