linksplatform / Memory

LinksPlatform's Platform.Memory Class Library
https://linksplatform.github.io/Memory
The Unlicense
1 stars 1 forks source link

Use optional static polymorphism instead of direct inheritance from interface #75

Open Konard opened 2 years ago

Konard commented 2 years ago

https://github.com/linksplatform/Memory/blob/1dd28922798abf85cbf535a5367395d399b5ec1d/cpp/Platform.Memory/ArrayMemory.h#L4 9519D724-7DAB-4E4F-9B4D-20B2EB432D38 This is only an example, we should use new style in all code files.

uselessgoddess commented 2 years ago

Why is static polymorphism here?

Konard commented 2 years ago

@uselessgoddess because we already use it in other repositories.

uselessgoddess commented 2 years ago

Ok, bro

uselessgoddess commented 2 years ago

Can I see link to small example of usage it

Konard commented 2 years ago

@uselessgoddess https://github.com/linksplatform/Data.Doublets/blob/ff09a843b3363e3b5512dd659f469a9190838bae/cpp/Platform.Data.Doublets/Memory/United/Generic/UnitedMemoryLinksBase.h#L15

and usage example:

https://github.com/linksplatform/Data.Doublets/blob/14b4bb47f603604c670c66e056c55b45ab5315d8/cpp/Platform.Data.Doublets.Tests/Dynamic/GenericLinksTests.cpp#L25.

uselessgoddess commented 2 years ago

But... dynamic polymorphism it is:

DynType = x

but not:

DynType<Generic1, Generic2, ...> = x
Konard commented 2 years ago

Dynamic polymorphism is

Doublets::ILinks<LinksOptionsType> storage = UnitedMemoryLinks<…>;