Giter Club home page Giter Club logo

out_ptr's People

Contributors

drfrankenstein avatar eliaskosunen avatar ldionne avatar thephd avatar udaken avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

out_ptr's Issues

Specialization: boost::shared_ptr

Some internal work needs to be done for boost::shared_ptr. Specifically, an additional OR'd condition needs to be added to this place here to ensure that boost::shared_ptr does not fall into the same pitfall as std::shared_ptr as documented by that static_assert.

The goal will be to forward declare the boost::shared_ptr type and then write the another is_specialization_of call there.

Example: Use with boost::intrusive_ptr and COM

An example should be written using boost::intrusive_ptr with the Microsoft COM API. You can adapt the example as shown in this documentation here.

This example should just demonstrate how to use std::out_ptr with boost::intrusive_ptr: it can be filled in here.

This example should apply #ifdef _WIN32 ... #endif around it, since getting it to compile will require including Windows SDK types and classes.

Example: Use with std::/boost::shared_ptr

An example should be written using a std::shared_ptr and boost::shared_ptr with a C API. There is a fictional C API with ficapi: you can look at the tests here to see it and see the actual shim repository and its functions.

This example should just demonstrate how to use std::out_ptr and std::inout_ptr with std::shared_ptr and boost::shared_ptr: it can be filled in here and here.

Example: Use with pthread_create/pthread_join

An example should be written using the pthread API (example here) that shows the usage of out_ptr to retrieve the exit value returned by the executed pthread function. It should show off the out_ptr<void*>(...).

The example can be written into here. Since this is Linux-specific, it should be gated by a #ifdef __linux__ ... #endif.

Remove C++14-ism: std::enable_if_t

This is meant to be a C++11 Boost Library. Therefore, all C++14-isms must go away. One of those C++14-isms if std::enable_if_t: it should be replaced by boost::mp11::mp_if_c<(Boolean Condition), void>!

This issue is to make sure none of those are left.

Double free on unset clever_out_ptr

If I read the implementation correctly, the clever_out_ptr can double-free the smart pointer.

Setup:

  • Have a unique_ptr with a value (non-NULL)
  • Pass this into a function via clever_out_ptr
  • function fails and does not set the pointer
  • clever_out_ptr checks the original pointer, sees it is != null and calls the deleter
  • deleter of unique_ptr calls delete on the same ptr

Am I missing anything or can you confirm this bug?

Example: Use with std::unique_ptr

An example should be written using a std::unique_ptr with a C API. There is a fictional C API with ficapi: you can look at the tests here to see it and see the actual shim repository and its functions here.

This example should just demonstrate how to use std::out_ptr and std::inout_ptr with std::unique_ptr: it can be filled in here.

Documentation

This library needs documentation.

While it is a simpler library, having all of the important information in the proposal is not suitable for submission to Boost. We need a form of documentation and a way of documenting it.

Some documentation systems we could use:

  • ascii doc
  • Sphinx

We also need a quick overview in the readme.

Test: Exceptions

One area that more tests could be performed for is to test if resource leakage occurs if an exception is thrown after the desired API is used and there's a failure. There is a function in the tests for producing a "failure": please use it and test what happens if an exception is thrown and caught post-success and post-failure.

Namespaces

New libraries should use boost::library:: namespaces. e.g. boost::out_pointer:: (or boost::out_ptr::, but boost::out_ptr::out_ptr doesn't look very nice).

i.e. Only the older existing libraries use just namespace boost::. All newer libraries have been required to create a namespace within boost:: and use that.

Your detail namespace then becomes boost::library::detail::.

Continuous Integration

We need contiguous integration. There are a number of providers. The two I am most familiar with are:

  • Appveyor, for Windows builds
  • TravisCI, for Linux builds

There are other providers but I do not know how to use them.

The core of this should be setting up the platform and then invoking the following:

  • cd the_build_dir (optional)
  • cmake path/to/source/dir -GNinja -DCMAKE_BUILD_TYPE=Debug -DBOOST_OUT_PTR_TESTS=ON -DBOOST_OUT_PTR_EXAMPLES=ON -DBOOST_OUT_PTR_CI=ON
  • ctest --build-config Debug --output-on-failure

Remove C++17-ism: std::*_v

A C++17-ism is the type traits that are suffixed by _v. What it does is produce an actual boolean value representing the original type trait's ::value boolean: either true or false. All instances of _v need to be removed to explicitly used the regular type trait and then getting it suffixed by ::value.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.