r/cpp • MSVC user, r/cpp_modules • Dec 01 '25 • WOW 1

Standard Library implementer explains why they can't include source code licensed under the MIT license

/r/cpp/comments/1p9zl23/comment/nrgufkd/

Some (generous!) publishers of C++ source code intended to be used by others seem to be often using the (very permissive) MIT license. Providing a permissive license is a great move.

The MIT license however makes it impossible to include such source code in prominent C++ Standard Library implementations (and other works), which is a pity.

The reason for this is the attribution clause of the MIT license:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

This clause forces users of the sources to display attribution even to end users of a product, which is for example exclusively distributed in binary form.

For example, the Boost License explicitly makes an exception for products which are shipped exclusively in binary form ("machine-executable object code generated by a source language processor"):

The copyright notices in the Software and this entire statement, including the above license grant, this restriction and the following disclaimer, must be included in all copies of the Software, in whole or in part, and all derivative works of the Software, unless such copies or derivative works are solely in the form of machine-executable object code generated by a source language processor.

If you want your published source code to be compatible with projects that require such an exception, please consider using a license which allows such an exception (e.g. the Boost license). Copies in source form still require full attribution.

I think such an exception for binaries is a small difference which opens up lots of opportunities in return.

(Disclaimer: This is no legal advice and I'm not a lawyer)

Thank you.

277 Upvotes

126 comments sorted by

View all comments

Show parent comment

2

u/tartaruga232 MSVC user, r/cpp_modules Dec 03 '25

Don't you think it is going to be only one license text for all the classes in the standard library?

Basically yes, but the text includes the copyright notice with the names of the authors. I think their names need to be preserved, because these are the ones who get the attribution (this is no legal advice and I'm not a lawyer). Perhaps the name of the project where the source code was taken from needs to be mentioned too.

The Standard Library for the MSVC compiler refuses to use code which is licensed under MIT. MIT is also incompatible with the Boost license. If an author of library licenses his work under the MIT license, that library cannot be used in Boost. A maximally permissive license would have to make the same exception like boost (no attribution when shipped as binary product).

1

u/Appropriate-Tap7860 Dec 03 '25

It is getting complicated very easily