osrm-backend/server
Daniel J. Hofmann f9f0ffb64d Remove hand written conversion code and replace with stdlib features.
With C++11 the stdlib gains:

- `std::stoi` function family to convert from `std::string` to integral type

- `std::to_string` to convert from number types to `std::string`

The only reason for hand-writing the conversion code therefore is
performance. I benchmarked an `osrm-extract` with the hand-written code
against one with the stdlib conversion features and could not find any
significant difference (we switch back and forth between C++ and Lua,
shaving off a few us in conversion doesn't gain us much).

Formatting arithmetic types in the default format with given precision
requires streams, but is doable in a few lines of idiomatic stdlib code.

For this, there is now the following function template available:

    template <Arithmetic T, int Precision = 6>
    inline std::string to_string_with_precision(const T);

that requires integral or floating point types and returns a formatted
string in the defaukt format with the given precision applied.

In addition this completely rips out Boost.Spirit from the `casts.hpp`
header, resulting in faster compile times.

Boom!

References:

- http://en.cppreference.com/w/cpp/string/basic_string/stol
- http://en.cppreference.com/w/cpp/string/basic_string/to_string
- http://www.kumobius.com/2013/08/c-string-to-int/
2015-09-29 16:15:54 +02:00
..
data_structures Remove Boost.Filesystem v3 fix for Boost < 1.48, refactor call sites. 2015-09-29 16:15:54 +02:00
http Remove hand written conversion code and replace with stdlib features. 2015-09-29 16:15:54 +02:00
api_grammar.hpp remove possibility to choose algorithm but only use brute force and farthest insertion 2015-09-01 15:20:34 +02:00
connection.cpp Extend compressed output lifetime till the async write function finishes. 2015-09-16 02:06:58 +02:00
connection.hpp Extend compressed output lifetime till the async write function finishes. 2015-09-16 02:06:58 +02:00
request_handler.cpp Remove hand written conversion code and replace with stdlib features. 2015-09-29 16:15:54 +02:00
request_handler.hpp change copyright line from personal names to project 2015-02-19 09:19:51 +01:00
request_parser.cpp Bugfix: allow POST request without POST data 2015-09-24 14:40:35 +02:00
request_parser.hpp Handle POST request when spanning multiple packets 2015-05-31 21:34:38 +02:00
server.hpp Remove hand written conversion code and replace with stdlib features. 2015-09-29 16:15:54 +02:00