From 6fb71c43321dc632773a44be0a48cc25ebd1dbcd Mon Sep 17 00:00:00 2001 From: Emmanuel Nyarko Date: Fri, 17 May 2024 14:57:17 +0000 Subject: [PATCH] simple map.d module --- source/stdcpp/map.d | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 source/stdcpp/map.d diff --git a/source/stdcpp/map.d b/source/stdcpp/map.d new file mode 100644 index 0000000..fc47718 --- /dev/null +++ b/source/stdcpp/map.d @@ -0,0 +1,23 @@ +/** + * D bindings for std::map + * see_Also: + * https://en.cppreference.com/w/cpp/container/map + * Copyright: Copyright (c) 2023 D Language Foundation + * License: Distributed under the + * $(LINK2 http://www.boost.org/LICENSE_1.0.txt, Boost Software License 1.0). + * (See accompanying file License) + * Authors: Emmanuel Nyarko, Mathias Lang + */ +module stdcpp.map; + + extern(C++, class): + struct Map(Key, Value) + { + extern(D) void opIndexAssign (const Key key, Value value) + { + this.insertOrAssign(key, value); + } + + static Map* make(); + private void insertOrAssign(const ref Key, const ref Value); + } \ No newline at end of file