Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the "detail" and "impl" folders for?

Tags:

c++

stl

boost

When messing with STL and boost, I keep seeing folders called "detail" or "impl". What is the purpose for these folders? How do you know what belongs in here?

Are these just private implementations of interfaces?

like image 518
Todd Avatar asked Feb 11 '23 15:02

Todd


1 Answers

What is the purpose for these folders?

Are these just private implementations of interfaces?

Basically, yes. It's where Boost and implementations of the standard library typically put stuff that isn't part of the public interface they expose, but needs to be accessible by the implementations of public interfaces.

How do you know what belongs in here?

This is kind of a difficult question to answer because it implies that you can, from the outside looking in, come to a conclusion about where stuff should be in these directories. You should consider these directories to be the analog of "no user servicable parts inside." You can look in and poke around but you never know what you might find, and it could even change between versions of Boost or your C++ environment.

Using header files in these directories directly in your application is highly discouraged and will lead to non-portable code that can break by even minor upgrades to Boost or your C++ compiler.

Having said that, there is no reason you can't explore inside these directories to see how stuff works under the hood!

like image 64
cdhowie Avatar answered Feb 15 '23 11:02

cdhowie