An open API service indexing awesome lists of open source software.

https://github.com/mguludag/cpp-pimpl-helper

A simple helper type alias for std::unique_ptr and custom deleter for using pimpl idiom with std::unique_ptr easily
https://github.com/mguludag/cpp-pimpl-helper

cpp pimpl unique-ptr

Last synced: 10 months ago
JSON representation

A simple helper type alias for std::unique_ptr and custom deleter for using pimpl idiom with std::unique_ptr easily

Awesome Lists containing this project

README

          

# cpp-pimpl-helper
A simple helper type alias for std::unique_ptr and custom deleter for using pimpl idiom with std::unique_ptr easily on MSVC

## Usage
*impl.hpp*
```C++
#include

class Impl
{
public:
...

private:
class Pimpl_;
stdx::pimpl::unique_ptr pimpl_;
};
```
*impl.cpp*

```C++
#include "impl.hpp"
...

class Pimpl_
{
...
};

Impl::Impl()
{
pimpl_ = stdx::pimpl::make_unique(...);
...
}
...
```