Hmm. Do people use PIMPL that much (I have used it, but rarely) that we need std library support (and testing, documentation, understanding)? Just asking.
Yes, if you actually care compile times.
The PImpl idiom and the C++26 std:indirect type
21–30 of 122 posts
Re: The PImpl idiom and the C++26 std:indirect type
#22I am wondering why C++ can't implement "non-null" unique_ptr version in the same way? As I know, that the main argument against implementing it is, that it's can't be done, since move-out unique_ptr still can be null.
Re: The PImpl idiom and the C++26 std:indirect type
#23Re: The PImpl idiom and the C++26 std:indirect type
#24Hmm. Do people use PIMPL that much (I have used it, but rarely) that we need std library support (and testing, documentation, understanding)? Just asking.
Yes, if you actually care compile times.
Re: The PImpl idiom and the C++26 std:indirect type
#25Earlier quoted context omitted.
where "more and more complex" do u see in this article? This is a basic C++ idiom, which constantly used by developers
std::indirect looks for me like another pointless c++ thing that already works with forward pointer declaration. You can add it to another ton of pointless things C++ adds without fixing the old ones. The issue with c++ is that it is so big, that everyone uses some kind of dialect of it and the fancier it gets, the less readable it becomes and the more magic happens behind the curtains. A developer of a C++ codebase…
Re: The PImpl idiom and the C++26 std:indirect type
#26Re: The PImpl idiom and the C++26 std:indirect type
#27C++ is getting more and more complex. It used to be said that people use only a small percentage of it when writing C++, but I am beginning to think that the cake is a lie here.
People will contend themselves with "C++ the good parts", helped by clang-tidy, PVS, MSVC analyse, and move on.
Re: The PImpl idiom and the C++26 std:indirect type
#28Earlier quoted context omitted.
where "more and more complex" do u see in this article? This is a basic C++ idiom, which constantly used by developers
Yes. If anything, this is taking a complex yet common idiom and making it simpler.
Re: The PImpl idiom and the C++26 std:indirect type
#29Hmm. Do people use PIMPL that much (I have used it, but rarely) that we need std library support (and testing, documentation, understanding)? Just asking.
Back when I used to write C++ it was used all over the place. Admittedly that was a log time ago.