19/04/20 13:35:42.76 7hm/FBJ7.net
>>347
ちゃんと考えたら >>354 はいらんことしとるな……
これで充分か
#include <map>
#include <memory>
#include <utility>
using KVPCollectionType = std::map<std::string, std::string>;
class c {
public:
c(const KVPCollectionType&& kvps = {}){}
};
std::shared_ptr<c> make_c_shared(KVPCollectionType&& a) {
return std::make_shared<c>(std::move(a));
}
int main() {
auto ok = make_c_shared(KVPCollectionType{{"key1", "value1"},{"key2","value2"}});
auto ng = make_c_shared({{"key1", "value1"},{"key2","value2"}});
}