Skip to content
This repository was archived by the owner on Mar 1, 2022. It is now read-only.

Commit b463228

Browse files
committed
add toHash snippet
1 parent 84e939d commit b463228

File tree

1 file changed

+16
-0
lines changed
  • source/workspaced/com/snippets

1 file changed

+16
-0
lines changed

source/workspaced/com/snippets/plain.d

+16
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,22 @@ static immutable PlainSnippet[] plainSnippets = [
207207
"Equality operators in form of `this == other` or `other == this` and also used for `!=`.\n\n"
208208
~ "Reference: [https://dlang.org/spec/operatoroverloading.html#equals]"
209209
),
210+
PlainSnippet(
211+
[SnippetLevel.type],
212+
"toHash",
213+
"size_t toHash() in struct",
214+
"size_t toHash() const @safe pure nothrow {\n\t$0\n}",
215+
"Hash generation for associative arrays.\n\n"
216+
~ "Reference: [https://dlang.org/spec/hash-map.html#using_classes_as_key]"
217+
),
218+
PlainSnippet(
219+
[SnippetLevel.type],
220+
"toHashClass",
221+
"size_t toHash() in class",
222+
"override size_t toHash() @safe nothrow {\n\t$0\n}",
223+
"Hash generation for associative arrays.\n\n"
224+
~ "Reference: [https://dlang.org/spec/hash-map.html#using_struct_as_key]"
225+
),
210226
PlainSnippet(
211227
[SnippetLevel.type],
212228
"opCmp",

0 commit comments

Comments
 (0)