The author must be willing to participate in discussions on the mailing list,
and to refine the library accordingly.

There's no requirement that an author read the mailing list for a time before
making a submission. It has been noted, however, that submissions which begin
"I just started to read this mailing list ..." seem to fail, often
embarrassingly.

A library's interface must portable and not restricted to a
particular compiler or operating system.

A library's implementation must if possible be portable and not
restricted to a particular compiler or operating system. If a portable
implementation is not possible, non-portable constructions are acceptable if
reasonably easy to port to other environments, and implementations are provided
for at least two popular operating systems (such as UNIX and Windows).

There is no requirement that a library run on C++ compilers which
do not conform to the ISO standard.

There is no requirement that a library run on any particular C++
compiler. Boost contributors often try to ensure their libraries work
with popular compilers. The boost/config.hpp
configuration header is the preferred mechanism for working around
compiler deficiencies.

Since there is no absolute way to prove portability, many boost
submissions demonstrate practical portability by compiling and executing
correctly with two different C++ compilers, often under different operating
systems. Otherwise reviewers may disbelieve that porting is in fact
practical.

Are you sure you own the library you are thinking of
submitting? "How to Copyright Software" by MJ Salone, Nolo Press,
1990 says:

Doing work on your own time that is very similar to programming
you do for your employer on company time can raise nasty legal problems.
In this situation, it's best to get a written release from your employer in
advance.

Place a copyright notice in all the important files you submit.
Boost won't accept libraries without clear copyright information.

Aim first for clarity and correctness; optimization should be only a secondary
concern in most Boost libraries.

Aim for ISO Standard C++. Than means making effective use of the standard
features of the language, and avoiding non-standard compiler extensions. It
also means using the C++ Standard Library where applicable.

Please leave an empty line before and after the copyright and license comments.
It is fine if the copyright and license messages are on different lines, but
there should be no other intervening text. Do not include "All rights reserved"
in the copyright message.

Note that developers should not include a copy of LICENSE_1_0.txt in
their libraries; Boost distributions already include a copy in the Boost root
directory.

A comment line referencing your library on the Boost web site. For example:

// See http://www.boost.org/libs/foo for library home page.

where foo is the directory name (see below) for your library. As
well as aiding users who come across a Boost file detached from its
documentation, some of Boost's automatic tools depend on this comment to
identify which library header files belong to.

Make sure your code compiles in the presence of the min() and max()
macros. Some platform headers define min() and max() macros which
cause some common C++ constructs to fail to compile. Some simple tricks can protect your code
from inappropriate macro substitution:

If you want to call std::min() or std::max():

If you do not require argument-dependent look-up, use (std::min)(a,b).

If you do require argument-dependent look-up, you should:

#include <boost/config.hpp>

Use BOOST_USING_STD_MIN(); to bring std::min() into
the current scope.

Use min BOOST_PREVENT_MACRO_SUBSTITUTION (a,b); to make an
argument-dependent call to min(a,b).

If you want to call std::numeric_limits<int>::max(), use
(std::numeric_limits<int>::max)() instead.

If you want to call a min() or max() member function,
instead to doing obj.min(), use (obj.min)().

If you want to declare or define a function or a member function named min
or max, then you must use the BOOST_PREVENT_MACRO_SUBSTITUTION
macro. Instead of writing int min() { return 0; } you should write
int min BOOST_PREVENT_MACRO_SUBSTITUTION () { return 0; } This is true
regardless if the function is a free (namespace scope) function, a member function or a
static member function, and it applies for the function declaration as well as the
function definition.

File and directory names must contain only lowercase ASCII letters , numbers,
underscores, and a period. Leading character must be alphabetic. Maximum
length 31. Only a single period is permitted. These requirements ensure
file and directory names are relatively portable.

Files intended to be processed by a C++ compiler as part
of a translation unit should have a three-letter
extension ending in "pp". Other files should
not use extensions ending in "pp". This
convention makes it easy to identify all of the C++ source
in Boost.

All libraries have at their highest level a primary directory named for the
particular library. See Naming consistency.
The primary directory may have sub-directories.

For very simple libraries implemented entirely within the library header, all
files go in the primary directory (except headers, which go in the boost header
directory).

The primary directory should always contain a file named index.html (or
index.htm). Authors have requested this so that they can publish URL's in the
form http://www.boost.org/libs/lib-name with the assurance a
documentation reorganization won't invalidate the URL. Boost's internal tools
are also simplified by knowing that a library's documentation is always
reachable via the simplified URL.

If the documentation is in a doc sub-directory, the primary directory
index.html file should just do an automatic redirection to the doc
subdirectory:

As library developers and users have gained experience with Boost, the
following consistent naming approach has come to be viewed as very helpful,
particularly for larger libraries that need their own header subdirectories
and namespaces.

Here is how it works. The library is given a name that describes the contents
of the library. Cryptic abbreviations are strongly discouraged. Following the
practice of the C++ Standard Library, names are usually singular rather than
plural. For example, a library dealing with file systems might chose the
name "filesystem", but not "filesystems", "fs" or "nicecode".

The library's primary directory (in parent boost-root/libs) is given
that same name. For example, boost-root/libs/filesystem.

The library's primary header directory (in parent boost-root/boost) is
given that same name. For example, boost-root/boost/filesystem.

The library's primary namespace (in parent ::boost) is given that same
name, except when there's a component with that name (e.g., boost::tuple), in which case the namespace name is pluralized. For example, ::boost::filesystem.

When documenting Boost libraries, follow these conventions (see also the following section of this document):

The library name is set in roman type.

The library name is capitalized.

A period between "Boost" and the library name (e.g., Boost.Bind) is used if and only if the library name is not followed by the word "library".

The word "library" is not part of the library name and is therefore lowercased.

Even the simplest library needs some documentation; the amount should be
proportional to the need. The documentation should assume the readers
have a basic knowledge of C++, but are not necessarily experts.

The format for documentation should be HTML, and should not require an advanced
browser or server-side extensions. Style sheets are acceptable.
ECMAScript/JavaScript is not acceptable. The documentation entry point should
always be a file named index.html or index.htm; see Redirection.

There is no single right way to do documentation. HTML documentation is often
organized quite differently from traditional printed documents. Task-oriented
styles differ from reference oriented styles. In the end, it comes down to the
question: Is the documentation sufficient for the mythical "average" C++
programmer to use the library successfully?

Appropriate topics for documentation often include:

General introduction to the library.

Description of each class.

Relationship between classes.

For each function, as applicable, description, requirements (preconditions),
effects, post-conditions, returns, and throws.

Exception specifications [ISO 15.4] are sometimes coded to indicate what
exceptions may be thrown, or because the programmer hopes they will improved
performance. But consider the following member from a smart pointer:

T& operator*() const throw() { return *ptr; }

This function calls no other functions; it only manipulates fundamental data
types like pointers Therefore, no runtime behavior of the
exception-specification can ever be invoked. The function is completely
exposed to the compiler; indeed it is declared inline Therefore, a smart
compiler can easily deduce that the functions are incapable of throwing
exceptions, and make the same optimizations it would have made based on the
empty exception-specification. A "dumb" compiler, however, may make all kinds
of pessimizations.

For example, some compilers turn off inlining if there is an
exception-specification. Some compilers add try/catch blocks. Such
pessimizations can be a performance disaster which makes the code unusable in
practical applications.

Although initially appealing, an exception-specification tends to have
consequences that require very careful thought to understand. The
biggest problem with exception-specifications is that programmers use them as
though they have the effect the programmer would like, instead of the effect
they actually have.

A non-inline function is the one place a "throws nothing"
exception-specification may have some benefit with some compilers.

Dave Abrahams comments: An important purpose (I daresay the primary purpose) of
source code is communication: the documentation of intent. This is a doubly
important goal for boost, I think. Using a fixed-width font allows us to
communicate with more people, in more ways (diagrams are possible) right there
in the source. Code written for fixed-width fonts using spaces will read
reasonably well when viewed with a variable-width font, and as far as I can
tell every editor supporting variable-width fonts also supports fixed width. I
don't think the converse is true.

Tabs are banned because of the practical problems caused by tabs in
multi-developer projects like Boost, rather than any dislike in principle. See
mailing list archives. Problems include maintenance of a single source
file by programmers using tabs and programmers using spaces, and the difficulty
of enforcing a consistent tab policy other than just "no tabs". Discussions
concluded that Boost files should either all use tabs, or all use spaces, and
thus the decision to stick with spaces.

Before the 1.29.0 release, two Boost libraries added ECMAScript/JavaScript
documentation. Controversy followed (see mailing
list archives), and the developers were asked to remove the
ECMAScript/JavaScript. Reasons given for banning included:

Incompatible with some older browsers and some text based browsers.

Makes printing docs pages difficult.

Often results in really bad user interface design.

"It's just annoying in general."

Would require Boost to test web pages for ECMAScript/JavaScript compliance.

Makes docs maintenance by other than the original developer more difficult.

Rationale is defined as "The fundamental reasons for something; basis" by the
American Heritage Dictionary.

Beman Dawes comments: Failure to supply contemporaneous rationale for
design decisions is a major defect in many software projects. Lack of accurate
rationale causes issues to be revisited endlessly, causes maintenance bugs when
a maintainer changes something without realizing it was done a certain way for
some purpose, and shortens the useful lifetime of software.

Rationale is fairly easy to provide at the time decisions are made, but very
hard to accurately recover even a short time later.

As a library matures, it almost always accumulates improvements suggested to
the authors by other boost members. It is a part of the culture of
boost.org to acknowledge such contributions, identifying the person making the
suggestion. Major contributions are usually acknowledged in the
documentation, while minor fixes are often mentioned in comments within the
code itself.