Use Boost.Optional instead of custom optional monad implementation.

This switches out the `<variant/optional.hpp>` implementation of the
optional monad to the one from Boost.

The following trick makes sure we keep compile times down:

- use `<boost/optional/optional_fwd.hpp>` to forward declare the
  optional type in header, then include the full blown optional header
  only in the implementation file.

- do the same for the files we touch, e.g. forward declare osmium types,
  allowing us to remove the osmium header dependency from our headers:

      `namespace osmium { class Relation; }

  and then include the appropriate osmium headers in the implementation
  file only. We should do this globally...

References:

- http://www.boost.org/doc/libs/1_59_0/libs/optional/doc/html/index.html
- https://github.com/osmcode/libosmium/issues/123
This commit is contained in:
Daniel J. Hofmann
2015-09-18 14:26:32 +02:00
parent be506f7121
commit 82dd5d8ccf
6 changed files with 71 additions and 61 deletions
+4 -1
View File
@@ -35,11 +35,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "../util/json_logger.hpp"
#include "../util/matching_debug_info.hpp"
#include <variant/variant.hpp>
#include <cstddef>
#include <algorithm>
#include <deque>
#include <iomanip>
#include <numeric>
#include <utility>
#include <vector>
namespace osrm
{