atilaneves / automem

C++-style automatic memory management smart pointers for D
BSD 3-Clause "New" or "Revised" License
86 stars 15 forks source link

Unique does not support interfaces explicitly #49

Closed drug007 closed 4 years ago

drug007 commented 4 years ago

Unique does not support interfaces. Is it intended? If no is this PR the right way to implement this feature?

drug007 commented 4 years ago

Tests failed because I tested using dmd v2.088.1

atilaneves commented 4 years ago

Unique does not support interfaces. Is it intended? If no is this PR the right way to implement this feature?

I can understand the use-case, but I'm trying to figure out how that could work with the design as-is. One can't construct an interface.

atilaneves commented 4 years ago

Tests failed because I tested using dmd v2.088.1

The compiler versions supported are the ones defined in the CI configurations.

codecov-commenter commented 4 years ago

Codecov Report

Merging #49 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #49   +/-   ##
=======================================
  Coverage   99.00%   99.00%           
=======================================
  Files          11       11           
  Lines         803      803           
=======================================
  Hits          795      795           
  Misses          8        8           
Impacted Files Coverage Δ
source/automem/unique.d 95.65% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update a806e1f...afa6646. Read the comment docs.

drug007 commented 4 years ago

I just reproduce the question raised in our local community. I gave the advice to use abstract base class instead of interface. So I guess graceful prohibiting of interfaces would be enough currently.

drug007 commented 4 years ago

Currently using Unique with interfaces results in non obvious compilation error and causes questions. This PR makes the compilation error obvious.

I got the answer to my question and I want to complete the PR either merging or just closing. Thanks!