File: rationale.qbk

package info (click to toggle)
boost1.88 1.88.0-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 576,932 kB
  • sloc: cpp: 4,149,234; xml: 136,789; ansic: 35,092; python: 33,910; asm: 5,698; sh: 4,604; ada: 1,681; makefile: 1,633; pascal: 1,139; perl: 1,124; sql: 640; yacc: 478; ruby: 271; java: 77; lisp: 24; csh: 6
file content (19 lines) | stat: -rw-r--r-- 1,934 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
[/
  Copyright (c) Vladimir Batov 2009-2022
  Distributed under the Boost Software License, Version 1.0.
  See copy at http://www.boost.org/LICENSE_1_0.txt.
]

[section Rationale]

I was using textual configuration files extensively and was also processing and preparing considerable amounts of data in XML. Consequently, I had a need for an ['extendible] library that would provide a ['uniform] interface to convert various data between their internal binary representations and external (predominantly textual) representations. 

The `boost::lexical_cast` library (with its orthogonal and extendible design) looked very promising compared to others (see [@http://www.gotw.ca/publications/mill19.htm The String Formatters of Manor Farm] by H. Sutter for the discussion of alternatives). Unfortunately, 

* many deployed user types simply did not meet `boost::lexical_cast` requirements (namely, [@http://en.cppreference.com/w/cpp/named_req/DefaultConstructible ['Default Constructibility]]); 
* failure to convert a user-provided configuration parameter was not that rare or exceptional to justify the hassle and the overhead of exception processing; consequently, additional flexibility (['if], ['when] and ['how]) in handling conversion failures was needed;
* additional conversion-related functionality (such as formatting and locale support) were needed. 

The original hope was to see `boost::lexical_cast` extended to be applicable to a wider range of deployment scenarios. However, after discussions with Kevlin Henney (the `boost::lexical_cast` author) and in the Boost Developers forum it was collectively decided that the desired extensions were not compatible with the original design and the idea of what `boost::lexical_cast` embodied and, therefore, a new component with richer interface and functionality was needed. That decision resulted in the development of ['Boost.Convert] described in this document.

[endsect]