C++ Logo

std-proposals

Advanced search

[std-proposals] Constructing C++ standard stuctures from equivalent types

From: Smith, Jim <jim.smith_at_[hidden]>
Date: Mon, 18 Sep 2023 17:52:05 +0000
Hi All,

I would like to simply pass my data structure to its std c++ equivalent and have it construct from the given item or node.

For example:

auto& m = get_my_map();
...

// Using type deduction here for m instead of passing to template would be
std::map<int, std::string> m_map(m->node);
so I'm proposing a constructor for the standard data structures that will take a node type from a given structure and use it to construct itself using existing nodes and expected features of the node type.

Only the range constructors appear to be similar.

-- James S.

Received on 2023-09-18 17:52:23