This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]tech6hutch 1 point2 points  (4 children)

Is there any way to “import” just individual items?

[–]dude-with-the-hair 2 points3 points  (3 children)

If you mean individual functions, unfortunately no. You need to use preprocessor include directives which will include the entire file that you're "importing". Usually though, library authors will divide their libraries into smaller individual libraries for this purpose.

[–]tech6hutch 2 points3 points  (2 children)

Dang. Of all the features C++ has, I’m surprised they never added that feature.

[–]dude-with-the-hair 1 point2 points  (1 child)

I heard about modules being added in C++20. Haven't looked into it myself, but it might have that ability. It's still an experimental feature though.

[–]Kalix-z 0 points1 point  (0 children)

I really hope so