boost-ext / te

C++17 Run-time Polymorphism (Type Erasure) library
451 stars 38 forks source link

Adding non_owning_storage storage type #16

Closed uknys closed 6 years ago

uknys commented 6 years ago

From the dyno library dyno::non_owning_storage stores a pointer to an object that already exists, without worrying about the lifetime of that object. It allows implementing non-owning polymorphic views over objects, which is very useful.

Adapting this type of storage for Boost.TE

codecov[bot] commented 6 years ago

Codecov Report

Merging #16 into master will increase coverage by 0.05%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #16      +/-   ##
==========================================
+ Coverage   99.33%   99.39%   +0.05%     
==========================================
  Files          15       16       +1     
  Lines         452      492      +40     
==========================================
+ Hits          449      489      +40     
  Misses          3        3
Impacted Files Coverage Δ
test/te.cpp 100% <100%> (ø) :arrow_up:
example/nonowning.cpp 100% <100%> (ø)
include/boost/te.hpp 100% <100%> (ø) :arrow_up:

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 38e4cf0...77aeef4. Read the comment docs.

krzysztof-jusiak commented 6 years ago

Thanks, @uknys. Nice one! Would you be able to provide a test for non_owning_storage not to break the functionality in the future and to provide example usage? Thanks.

uknys commented 6 years ago

After countless typos and really avoidable errors, I got the basic tests for the non_owned_storage done. For the examples you want me to do it on the Readme file ?

krzysztof-jusiak commented 6 years ago

Would you be able to squash all your commits into one to have a clean history, please? An example in example/ folder would be awesome. Thank you, @uknys.