0

In D I can create templates like this:

template Foo(A) {
    A add(A a, A b) { ... }
    A multiply(A a, A b) { ... }
    A concatenate(A a, A b) { ... }
}

What should a template be named ideally? What conventions exist out there? I'm looking to something similar like 'function names must always start with a verb'.

Ivaylo Slavov
  • 790
  • 5
  • 16
Jeroen
  • 613

1 Answers1

1

In your case, I would use a name that refers to the collection of functions that you have. For example:

template Operations(A) { ...

If you hadn't mentioned concatenate, then I would have suggested ArithmeticOperations for example.

Greg Hewgill
  • 10,201