Skip to content

Replacing Values in a toml::array #109

@LebJe

Description

@LebJe

Is your feature request related to a problem? Please describe.
It seems that there's no way to replace a value in a toml::array. Currently, I'm using this code:

auto array = toml::array { 0, 1, 2, 3 };

if (array.get(0)) {
	array.erase(array.cbegin());
}

array.insert(array.cbegin(), 5);

Describe the solution you'd like
I would like a way to easily replace a value, something like operator[] in std::vector:

auto stdVector = std::vector { 0, 1, 2, 3 };
stdVector[0] = 5;

Additional context
None

Metadata

Metadata

Assignees

Labels

featureNew feature or enhancement requestimplemented in v3Fixes + features which were implemented in v3 release.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions