5 | | As part of preparing my [http://cppnow.org/ C++ Now] 2015 presentation "[https://docs.google.com/presentation/d/1badtN7A4lMzDl5i098SHKvlWsQY-tsVcutpq_UlRmFI/pub?start=false&loop=false&delayms=3000 A review of C++ 11/14 only Boost libraries]" I examined ten C++ 11/14 mandatory libraries heading towards Boost. This wiki provides a shortlist of suggested best practices which Boost library authors may find useful when developing their own Boost libraries. To a large extent, this shortlist is mainly about achieving best practice in C++ 11/14 libraries of any kind and should be useful to anyone so interested. |
| 5 | As part of preparing my [http://cppnow.org/ C++ Now] 2015 presentation "[https://docs.google.com/presentation/d/1badtN7A4lMzDl5i098SHKvlWsQY-tsVcutpq_UlRmFI/pub?start=false&loop=false&delayms=3000 A review of C++ 11/14 only Boost libraries]" I examined ten C++ 11/14 mandatory libraries heading towards Boost which were: |
| 6 | |
| 7 | ||= Name =||= Authors =||= Min C++ =||= Boost headers required =||= Entered Boost peer review queue =||= Description =||= Repository =|| |
| 8 | || Boost.Fiber || Oliver Kowalke || 14 || Context, Config || Conditionally accepted || a framework for micro-/userland-threads (fibers) scheduled cooperatively || https://github.com/olk/boost-fiber || |
| 9 | || Boost.AFIO || Niall Douglas, Paul Kirth || 11 || none || 2013-10 || strongly ordered portable asynchronous filesystem and file i/o extending ASIO || https://github.com/BoostGSoC13/boost.afio || |
| 10 | || Boost.DI || Krzysztof Jusiak || 14 || none || 2015-01 || provides compile time, macro free constructor dependency injection || https://github.com/krzysztof-jusiak/di || |
| 11 | || Boost.Hana || Louis Dionne || 14 || none || 2015-04 || functional programming in C++ based around transformations of heterogeneous collections of types. || https://github.com/ldionne/hana || |
| 12 | || Boost.Http || Vinícius dos Santos Oliveira || 11 || asio, filesystem, system, datetime, utility || 2015-04 || create applications that need to expose services through HTTP || https://github.com/BoostGSoC14/boost.http || |
| 13 | || Boost.APIBind || Niall Douglas || 11 || none || not submitted yet || toolkit for modularizing Boost libraries, managing versioned API and ABI dependency binds, makes it easy for Boost libraries to switch between use of the C++ 11 STL and the Boost STL || https://github.com/ned14/Boost.BindLib || |
| 14 | || Boost.Expected || Pierre Talbot, Vicente J. Botet Escriba || 11 || none || not submitted yet || category and functional programming in C++ based around the monadic expected<T, E> || https://github.com/ptal/expected || |
| 15 | || Boost.Tick || Paul Fultz II || 11 || none || not submitted yet || trait introspection and concept creator for C++11 || https://github.com/pfultz2/Tick || |
| 16 | || Boost.Fit || Paul Fultz II || 11 || none || not submitted yet || provides utilities for functions and function objects || https://github.com/pfultz2/Fit || |
| 17 | || Boost.Sqlpp11 || Roland Bock || 11 || none || not submitted yet || A type safe embedded domain specific language for SQL queries and results in C++ || https://github.com/rbock/sqlpp11 || |
| 18 | |
| 19 | There was very significant divergence in best practices between these libraries at the time of examination, and moreover the divergences were uneven possibly reflecting an uneven understanding of what best practice might be in C++ 11/14. Thence from my examination I have prepared the list below of what I felt were best practices in C++ 11/14 mandatory libraries with hyperlinks to the relevant source code files in the relevant libraries above. As what a "best practice" is or is not may vary according to opinion, I have attempted to provide a rationale for each of the suggestions below. It is up to library authors to weigh each suggestion and to decide whether to apply it, or not, to their library. |
| 20 | |
| 21 | One will note that the list below is much more C++ 11/14 focused than Boost focused. This is because it is derived from the first crop of C++ 11/14 mandatory Boost libraries. This is not a handbook for writing Boost libraries or even C++ 11/14 Boost libraries, if you want that [http://www.boost.org/development/requirements.html first start reading here] (note some of the guidelines on that page don't really apply to C++ 11/14 libraries) and [http://rrsd.com/blincubator.com/requirements/ then read here] and [http://rrsd.com/blincubator.com/advice/ here]. |
| 22 | |
| 23 | I have tried to keep these points generic to all C++ 11/14 libraries in the hope that they are useful far outside Boost. I have also ordered them with what I consider the most important ("strongly consider") first and not as important ("consider") later. |