The nearly exact VB equivalent to the C++ std::unordered_map collection is the .NET Dictionary collection. (The VB equivalent to the C++ std::map collection is the .NET SortedDictionary collection).
C++ | VB |
---|---|
#include <string> #include <unordered_map> void UnorderedMap() { std::unordered_map<std::wstring, int> map; std::wstring s = L"test"; map.insert(std::make_pair(s, 1)); int i = map[s]; i = map.size(); bool b = map.empty(); map.erase(s); } |
Imports System.Collections.Generic Sub UnorderedMap() Dim map As New Dictionary(Of String, Integer)() Dim s As String = "test" map.Add(s, 1) Dim i As Integer = map(s) i = map.Count Dim b As Boolean = map.Count = 0 map.Remove(s) End Sub |
Use C++ to VB Converter to convert from C++ to VB.
Additional resource:
VB.NET and C++ Equivalents
Copyright © 1997 – 2019 Tangible Software Solutions, Inc.