From 27b87ae08b621c462dc3fdc23ecbde99b2605646 Mon Sep 17 00:00:00 2001 From: Emmanuel Nyarko Date: Fri, 17 May 2024 15:08:40 +0000 Subject: [PATCH] #add insertorassign add opIndexAssign test --- extras/AssociativeContainers/map.hpp | 6 +++--- source/stdcpp/test/map.d | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/extras/AssociativeContainers/map.hpp b/extras/AssociativeContainers/map.hpp index efaef20..0f95d1a 100644 --- a/extras/AssociativeContainers/map.hpp +++ b/extras/AssociativeContainers/map.hpp @@ -14,10 +14,10 @@ class Map { static Map* make() {return new Map(); } - /*void insertOrAssign(const K& key, const V& value) + void insertOrAssign(const K& key, const V& value) { this->map.insert_or_assign(key, value); } - */ + std::map map; -}; \ No newline at end of file +}; diff --git a/source/stdcpp/test/map.d b/source/stdcpp/test/map.d index dd2db93..fe3441e 100644 --- a/source/stdcpp/test/map.d +++ b/source/stdcpp/test/map.d @@ -11,6 +11,6 @@ import stdcpp.map; unittest { auto mymap = Map!(int, char).make(); - mymap.opIndexAssign(4, 'a'); + map.opIndexAssign(1, 'a'); }