Skip to content

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

License

Notifications You must be signed in to change notification settings

mguludag/cpp-pimpl-helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

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

#include <pimpl.hpp>

class Impl
{
public:
  ...

private:
  class Pimpl_;
  stdx::pimpl::unique_ptr<Pimpl_> pimpl_;
};

impl.cpp

#include "impl.hpp"
...

class Pimpl_
{
  ...
};

Impl::Impl()
{
  pimpl_ = stdx::pimpl::make_unique<Pimpl_>(...);
  ...
}
...

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages