looking for a D3 stl project

H. S. Teoh hsteoh at qfbox.info
Wed Jan 17 02:18:28 UTC 2024


On Mon, Jan 15, 2024 at 10:01:04PM +0000, Alexandru Ermicioi via Digitalmars-d wrote:
> On Monday, 15 January 2024 at 19:48:30 UTC, H. S. Teoh wrote:
> > My personal goal is to make my algorithms *completely* data
> > structure agnostic.
> 
> Just wondering how can this be achieved? Per my understanding any
> algorithm would require some set of functionality from any data
> structure it accepts, so that it could properly work.

Well yes, but one could use DbI to discover the capabilities of an input
structure, and adapt accordingly.  Of course, the algorithm would need
*some* minimum functionality to work, but this minimal functionality may
change depending on the structure, and there may not be a common core of
minimum functionality. For example, there could be two algorithms, or
two implementations of an algorithm, with the same interface, that could
perform some operation, and they would be chosen depending on which
capabilities are presented by the structure.


T

-- 
"You are a very disagreeable person." "NO."


More information about the Digitalmars-d mailing list