Skip to content

explicit constructor with default does not compile #3077

Closed
@bpmckinnon

Description

@bpmckinnon

From include/nlohmann/json.hpp
image
The change from ValueType ret; to ValueType ret{}; is causing a compiler error for the construction of a type with an explicit default constructor of the form.

explicit Foo(const alloc_context& allocContext = alloc_context())

In vs2019 it gives the following errors, using c++17
error C2512: '###': no appropriate default constructor available
note: Constructor for class '###' is declared 'explicit'

This is happening in a from_json call to my custom container type

Worked in 3.9.1, does not work in 3.10.2

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions