introduction.qbk 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. [/
  2. Copyright (c) Vladimir Batov 2009-2016
  3. Distributed under the Boost Software License, Version 1.0.
  4. See copy at http://www.boost.org/LICENSE_1_0.txt.
  5. ]
  6. [section Introduction]
  7. ['Boost.Convert] builds on the `boost::lexical_cast` experience and takes those type conversion\/transformation-related ideas further
  8. * to be applicable to a wider range of conversion-related deployment scenarios,
  9. * to provide a more flexible, configurable and extendible type-conversion framework,
  10. * to provide generic consistent behavior,
  11. * to ['unify and to uniformly deploy] various conversion facilities ['through one consistent interface].
  12. ['Boost.Convert] provides new and familiar conversion\/transformation-related functionality such as:
  13. * means to deploy types that do not meet the [@http://en.cppreference.com/w/cpp/named_req/DefaultConstructible ['Default Constructibility]] requirement;
  14. * four types of the conversion-failure ['detection]:
  15. * as part of the same process flow -- basic and generic;
  16. * as a branched process flow -- exception-based and function-based;
  17. * the choice of immediate or delayed exception-throwing and non-throwing conversion-failure ['processing];
  18. * flexibility of conversion-failure ['processing] via:
  19. * an exception thrown;
  20. * the fallback value returned;
  21. * the fallback function called;
  22. * support for standard algorithms.
  23. ['Boost.Convert] consists of two components:
  24. * the `boost::convert()` interface;
  25. * an extendible collection of pluggable converters.
  26. The `boost::convert()` interface
  27. * advertises, provides and ensures certain ['consistent behavior];
  28. * unifies and provides ['one consistent interface] to various conversion facilities.
  29. The collection of pluggable converters is independent of the `boost::convert()` API facade and is designed to be ['extendible] and extended over time. Currently the following converters are provided:
  30. * `boost::lexical_cast`-based,
  31. * `printf/scanf`-based,
  32. * `strtol`-inspired,
  33. * `std::stringstream`-based,
  34. * `boost::spirit`-based.
  35. The converters provide new and familiar functionality and demonstrate how existing and independent conversion facilities might be incorporated in to the ['Boost.Convert] framework. For example, the `std::stream`-based converter draws on the standard `std::streams` functionality and provides:
  36. * string-to-type and type-to-string conversions;
  37. * formatting support (`std::ios`-based precision, base, upper/lower-case, scientific, etc.);
  38. * support for different `locale`s;
  39. * `char` and `wchar_t` support.
  40. [import ../example/algorithms.cpp]
  41. [algorithm_introduction]
  42. [endsect] [/section Introduction]