Skip to main content
Filter by
Sorted by
Tagged with
2 votes
1 answer
112 views

I am trying to hide some implementation behind an opaque data type. Normally, pimpl would be the preferred pattern, but it requires heap allocation which is not desirable in this context (embedded, ...
Dominik Kaszewski's user avatar
1 vote
0 answers
103 views

Foo.h class Foo { private: int a; bool b; float c; }; I have a class like the one above that is used when interacting with an API that itself interacts with the GPU. To reduce CPU->GPU ...
Spring E. Thing's user avatar
2 votes
2 answers
145 views

Here is a simplified code: https://godbolt.org/z/EnE76xMrP The pImpl will contain a mutex member which make the pImpl neither copyable nor movable. But the Foo class has unique_ptr of pImpl as member ...
omarekik's user avatar
0 votes
0 answers
213 views

I'm developing a C++ API and I want to hide private implementation details from the public interface. Currently, I'm employing the Pimpl idiom for this purpose. However, I'm also mindful of minimizing ...
ehopperdietzel's user avatar
3 votes
0 answers
122 views

First, I know that in pimpl design with std::unique_ptr, the destructor of the client class cannot be inline and needs to be implemented in the implementation file because the unique_ptr destructor ...
shan's user avatar
  • 396
5 votes
2 answers
694 views

the title may be a bit too short to be clear enough. We have a complex C/C++-project which is built and linked in a lot of separate targets as static libraries. So my problem is that the ...
NetoBF's user avatar
  • 178
0 votes
0 answers
63 views

We are developping an embedded project, where we use C++14 and PIMPL for the OS-Abstraction. So we have Task-PIMPL-Interface which gets implemented in the referenced operating-system-SDK. Currently a ...
NetoBF's user avatar
  • 178
3 votes
0 answers
263 views

Consider a standard class implementation that makes use of PImpl, but uses a std::unique_ptr to manage the implementation object's lifetime: class MyClass { public: class Impl; MyClass(); ...
Raven's user avatar
  • 3,658
0 votes
0 answers
202 views

I have a class which has a template member functions and the private members needs to be put in the implementation class by pimpl idiom approach. Foo.hpp #include <iostream> class Foo { public: ...
Tharani B's user avatar
3 votes
2 answers
403 views

Question: What am I doing to cause a multiple definition symbol linker error? OSFrameworkWindows10Module.ixx module; #include <memory> export module OSFrameworkWindows10Module; export class ...
Teeeeeeeeeeeeeeeeeeeeeeeeeeeej's user avatar
5 votes
1 answer
342 views

I use the pimpl idiom for classes in the public API of my library to benefit from it's properties like ABI stability. In my non-public code it would be convenient to have access to the impl object to ...
Jus Gru's user avatar
  • 106
0 votes
1 answer
121 views

I have an application class that can take in a dependent class as a template argument to the constructor. This dependent class is required to provide certain templated functions that the application ...
atab's user avatar
  • 1
0 votes
0 answers
116 views

I'm trying to create a C++ class hierarchy of UI "view" classes that wrap platform-specific UI classes. My classes use the pimpl idiom to hide the implementation from the header file. The ...
Rob N's user avatar
  • 16.7k
0 votes
0 answers
41 views

I am refactoring a biometric recognition SDK, which public API provide feature extraction and some CRUD feature management interface like: class PublicComponent{ public: FeaturePublic ...
user8510613's user avatar
  • 1,282
3 votes
0 answers
326 views

If having a c++ class with a pimpl using std::unique_ptr and solving the fact that the pimpl class is incomplete in the header by declaring my own destructor (I know i could also provide a custom ...
joaerl's user avatar
  • 1,062
17 votes
1 answer
678 views

This is a follow up of this question: Does PIMPL idiom actually work using std::unique_ptr? The full example uses multiple files, so for the sake of this question I will reduce it here. The full ...
463035818_is_not_an_ai's user avatar
2 votes
1 answer
1k views

I come from Java that has a different way in handling what's private and has to be hided regarding a class implementation and it also has a garbage collector which means there is no need for a ...
Spyromancer's user avatar
-1 votes
1 answer
401 views

AFAIK unique_ptr is quite tricky to use with PIMPL, since deleter is part of unique_ptr type so it will not work with incomplete types. On the other hand shared_ptr uses dynamic deleter so it works ...
NoSenseEtAl's user avatar
  • 30.9k
0 votes
1 answer
393 views

I am required to provide a solution to the following problem: A class is published as a library and made available to the world. It is designed in a way which does not use the pimpl approach. Two new ...
Mariah's user avatar
  • 111
1 vote
2 answers
182 views

I have a class setup that I have converted to use pimpl, something like this: (outline only, I'm aware this doesn't compile) struct GAME { unique_ptr<GAME_IMPL> _impl; explicit GAME() :...
c z's user avatar
  • 9,356
2 votes
1 answer
694 views

I'm trying to use unique_ptr for a pimpl idiom. So I'm declaring a destructor inside the class so the unique_ptr deletion is not instantiated where the impl class is not defined, and then I define it ...
Asaf's user avatar
  • 4,437
0 votes
1 answer
480 views

I am writing an application that needs to store objects of a class that uses the PIMPL idiom in a std::vector. Because the class uses std::unique_ptr to store a pointer to it's implementation and std::...
tjwrona's user avatar
  • 9,097
11 votes
1 answer
899 views

In my workplace, we have this convention: almost every class (with very few exceptions) is implemented with unique_ptrs, raw pointers or references as member variables. This is because of compilation ...
Dundo's user avatar
  • 784
1 vote
1 answer
442 views

pimpl.h #include <memory> class MyClassImpl; class MyClass { void Foo(); struct MyStruct { int a; int b; } variable_struct; private: std::unique_ptr<...
無名前's user avatar
  • 2,452
1 vote
0 answers
207 views

I've solved the problem by putting #include "stdafx.h" (this statement is missed in the original question, sorry for that) BEFORE #include "PImplTest.h" instead of AFTER it. But I'...
Irene's user avatar
  • 11

1
2 3 4 5
7