简体   繁体   中英

How to include all boost header files?

In Java if you wanted all the classes in a namespace you could just do this:

import com.bobdylan.*;

Is there anyway I can get a result similar to:

import boost.*;

(except in C++)

Not automatically. You can write a single header file that #includes all the other headers you are interested in, and then just #include that, but that's it - C++ has no "import" feature like java.

You probably don't want to #include all of Boost -- it's a very large library, so just include what you need.

Also, a Neil says, there is no equivalent in C++ to the Java .* syntax, so you must either include them all manually, or write a single header that includes them all manually and include that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM