![]() This didn’t seem so bad when dealing just with the Add library, but here, to include the Add and Subtract libraries from within the maths directory, we would need to go up a directory, like so: #include "./add/add.h" So far we’ve been relying on relative paths to include appropriate headers. The directory tree currently looks as follows. As we begin writing the Maths library, we face an issue. Thus we create a Maths library, again with a dedicated maths directory. The code isn’t up to our standards so we’d like to wrap our Add and Subtract libraries to align the interfaces and ensure consistent error-handling across the entire library. We remember that we have some old C code that handles subtracting somewhere, and decide to reuse it – we will create a subtract directory and place the following files within it. ![]() ![]() Let’s say that the Add library does not quite meet our needs any longer, and we’d like to build it up to a fully featured mathematical library. We will start by extending our project to facilitate the discussion. This will further grow our example project, preparing us for future discussions. While doing so I also return to the closely related concept of modular design, briefly mentioned in the previous post. I will show examples of using PRIVATE, INTERFACE and PUBLIC specifiers well. In this part instead of introducing yet more new features, I illustrate some practical applications of those already discussed. In the previous two parts of the series, I introduced quite a few new concepts.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |