Other than this frustration I am enjoying programming in D!
Proper way to accept either static or dynamic array as a parameter
Alex Bryan via Digitalmars-d-learn Sat, 11 Sep 2021 18:11:11 -0700
I am having trouble discovering what the proper (or at least a
proper) way is to write a function that can take either a static
or dynamic array as a parameter. My current implementation
consists of 2 overloaded functions (one takes a dynamic array,
the other takes a static array) with 99% copy/pasted code. My
intuition tells me this is dirty, and there's a better way to do
this with templates, but for the life of me I just can't figure
it out. Would someone be so kind as to please help me out?
- Proper way to accept either static or d... Alex Bryan via Digitalmars-d-learn
- Re: Proper way to accept either st... H. S. Teoh via Digitalmars-d-learn
- Re: Proper way to accept either st... Alex Bryan via Digitalmars-d-learn
- Re: Proper way to accept eithe... jfondren via Digitalmars-d-learn
- Re: Proper way to accept e... Alex Bryan via Digitalmars-d-learn