hashset 1.0.1

Hashset for D.


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

hashset

Hashset for D.

You just use it like you would think you use a HashSet.

How to use:


import std.stdio;

import hashset;

void main() {
	HashSet!int myCoolHashSet = HashSet!int([1, 4, 4, 234,]);

	myCoolHashSet.erase(1, 4, 234);

	myCoolHashSet.insert([1, 2, 3, 4]);

	myCoolHashSet.insert(HashSet!int(5, 6, 7, 8, 74, 3, 6, 1, 23, 3));

	writeln(myCoolHashSet);

	myCoolHashSet.insert(1, 2, 3, 4, 5);

	auto blah = HashSet!int(6, 7, 8, 9, 10);

	myCoolHashSet.insert(blah);

	writeln(myCoolHashSet);

	writeln(myCoolHashSet.merge(HashSet!int(11, 12, 13, 14, 15)));

	foreach (k; myCoolHashSet) {
		writeln(k);
	}

	writeln(myCoolHashSet.contains(HashSet!int(1, 2, 3)));

	myCoolHashSet.clear();

	writeln(myCoolHashSet.empty());

	writeln(HashSet!int().empty());

	writeln("=-=-=-=-==--==");

	{
		auto a = HashSet!string("one", "two", "three");
		auto b = HashSet!string("four", "five", "six");

		a.swap(b);

		writeln(a);
		writeln(b);
	}

    {
        auto tempTestCase = HashSet!int(1,2,3,4,5).merge(HashSet!int(6, 7, 8, 9, 10));

        assert(tempTestCase.contains(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
    }
}

If you are still confused, please see the source code or unit test.

Authors:
  • jordan4ibanez
Dependencies:
none
Versions:
1.1.0 2025-Feb-16
1.0.5 2025-Feb-08
1.0.4 2025-Feb-08
1.0.3 2025-Feb-08
1.0.2 2025-Feb-08
Show all 8 versions
Download Stats:
  • 0 downloads today

  • 5 downloads this week

  • 14 downloads this month

  • 14 downloads total

Score:
0.6
Short URL:
hashset.dub.pm