osrm-backend/util
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
..
bearing.hpp Refactor bearing implementation. 2015-09-29 16:15:54 +02:00
cast.hpp Remove hand written conversion code and replace with stdlib features. 2015-09-29 16:15:54 +02:00
compute_angle.cpp sprinkle a number of noexcepts into the code 2015-04-02 11:36:04 +02:00
compute_angle.hpp sprinkle a number of noexcepts into the code 2015-04-02 11:36:04 +02:00
container.hpp Revert parallelization on util that is used in the server. Let node do this. 2015-09-28 20:26:29 +02:00
datastore_options.hpp Remove Boost.Filesystem v3 fix for Boost < 1.48, refactor call sites. 2015-09-29 16:15:54 +02:00
dist_table_wrapper.hpp fix some small issues: 2015-09-01 15:20:35 +02:00
fingerprint_impl.hpp.in Fix magic number check for fingerprint 2015-06-19 17:51:35 +02:00
fingerprint.cpp add (new) fingerprint.cpp that includes the generated headers 2015-03-31 10:47:21 +02:00
fingerprint.hpp Check if FingerPrint is trivial. TODO: Add this for all other data that is going to be serialized 2015-06-19 18:10:49 +02:00
floating_point.hpp change copyright line from personal names to project 2015-02-19 09:19:51 +01:00
git_sha.cpp.in change copyright line from personal names to project 2015-02-19 09:19:51 +01:00
git_sha.hpp change copyright line from personal names to project 2015-02-19 09:19:51 +01:00
graph_loader.hpp Revert the usage of TBB's iterator pair taking overloads. 2015-09-28 20:37:09 +02:00
graph_utils.hpp Restructure the construction of the undirected graph 2015-07-01 18:07:29 +02:00
ini_file.hpp change copyright line from personal names to project 2015-02-19 09:19:51 +01:00
integer_range.hpp Change integer_range's .size() member function return type to size_t. 2015-09-28 15:00:21 +02:00
iso_8601_duration_parser.hpp First step into overhauling the edge storage 2015-06-01 17:22:12 +02:00
json_logger.hpp Do not include Boost.Thread is a sub-header is good enough. 2015-09-28 15:00:20 +02:00
json_renderer.hpp Remove hand written conversion code and replace with stdlib features. 2015-09-29 16:15:54 +02:00
json_util.hpp Address some of the remaining issues of the code review 2015-03-04 01:34:45 +01:00
lua_util.hpp Follow symlinks 2015-05-15 15:30:41 +02:00
make_unique.hpp change copyright line from personal names to project 2015-02-19 09:19:51 +01:00
matching_debug_info.hpp Modernize the code base to C++11 standards and beyond. 2015-08-18 12:56:34 +02:00
mercator.cpp sprinkle a number of noexcepts into the code 2015-04-02 11:36:04 +02:00
mercator.hpp sprinkle a number of noexcepts into the code 2015-04-02 11:36:04 +02:00
osrm_exception.cpp change copyright line from personal names to project 2015-02-19 09:19:51 +01:00
osrm_exception.hpp Modernize the code base to C++11 standards and beyond. 2015-08-18 12:56:34 +02:00
range_algorithms.hpp fix license header 2015-02-26 18:54:13 +01:00
routed_options.hpp Add loading of .core file to InternalDataFacade 2015-08-19 12:27:44 +02:00
simple_logger.cpp change copyright line from personal names to project 2015-02-19 09:19:51 +01:00
simple_logger.hpp change copyright line from personal names to project 2015-02-19 09:19:51 +01:00
std_hash.hpp change copyright line from personal names to project 2015-02-19 09:19:51 +01:00
string_util.hpp Replace custom replace utility with the stdlib's replace algorithm. 2015-09-28 15:00:20 +02:00
timing_util.hpp change copyright line from personal names to project 2015-02-19 09:19:51 +01:00
trigonometry_table.hpp change copyright line from personal names to project 2015-02-19 09:19:51 +01:00
xml_renderer.hpp Remove hand written conversion code and replace with stdlib features. 2015-09-29 16:15:54 +02:00