-
Couldn't load subscription status.
- Fork 782
Include ordering in cpp and header files
Fadri Furrer edited this page Jan 13, 2015
·
1 revision
In .cpp files, put:
- The corresponding header
- A block of system includes
- A block of includes from non-system packages (3rd party, viwls-graph, Eigen, etc)
- A block of includes from this package
Separate the blocks by vspace, and alphabetize within each block. For example, for a file foo.cpp in my-package:
#include "my-package/foo.h"
#include <memory>
#include <pthread.h>
#include <string>
#include <Eigen/Core>
#include <epipolar-matching/matcher.h>
#include <glog/logging.h>
#include <vi-map/map.h>
#include "my-package/bar.h"
#include "my-package/baz.h"Header file includes should follow the same structure.