如何用命名空间构建文件夹?

时间:2014-02-27 07:06:58

标签: c++ namespaces

我的项目目录如下:

proj
--src
--include
  --image_processing
    --kernel.hpp
  --image_processing.hpp

image_processing.hpp中,我有:

namespace ImageProcessing{
  class Kernel;
}

kernel.hpp,我有:

#include "image_processing.hpp"

class ImageProcessing::Kernel {
  //...
}

这是名称空间定义的正确/建议文件夹结构吗?

1 个答案:

答案 0 :(得分:0)

我习惯的是为每个命名空间使用一个文件夹(比如在块中跳转源),包括src和include。像。的东西。

proj
-- imageprocessing
    --src
    --include
        --kernel.hpp
        --image_processing.hpp
-- another namespace folder
....

但是我认为你可以按自己喜欢的方式行事。