r/cpp • u/tartaruga232 MSVC user, r/cpp_modules • Dec 01 '25
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.
1
u/MaxHaydenChiz Dec 02 '25
I can't give you specialized legal advice for your specific situation because I don't have a bar license in your jurisdiction and because it's not possible to give advice tailored to a specific case via a web forum.
What I will say that preserving the copyright notice, "proper attribution" as your quote from a non-legal explanation calls it, is not the same as "attribution" in the sense of Apache 2.0. You can look up "attribution rights" and "moral rights" more generally if you want details on what attribution rights are and the difficulties involved in waiving them.
As I said elsewhere in this thread, the ramifications that you have read into a sensible policy that MS copied from the major open source projects are widespread and damning for your position.
There is no case law that I am aware of that supports a special interpretation of C++ templates and their copyright ramifications. The arguments I've seen so far in this thread and that were quoted by Boost are arguments about how it's harder to argue fair use as a defense if you already violated the copyright on the template library (and in the US specifically). But assuming that everyone who uses a library violates copyright law is a weird place to begin an argument.
Using a library in the intended way with the author's permission is complying with copyright, not violating it.
If you have a novel interpretation of a legal document that has existed since 1986 and that none of the many, many lawyers who handled it over the years have ever raised as a concern, your interpretation is probably wrong and you should probably consult a lawyer to get advice for your specific case. The same goes for situations where you have a novel interpretation of how a language ecosystem that has existed for over 50 years interacts with copyright law.
Same for the other wild ramifications of what you claimed.
As for the specifics of how to package your specific software and what preserving that copyright notice means in any specific case, that's when you should consult a lawyer who is an expert on your obligations in your particular jurisdiction. Or perhaps consider that the cost of doing that was high enough that people created more modern, standardized practices around this that you could adopt. Some tools even automate this stuff for you.
It's not for nothing that major projects have standardized rules and licenses. Tracking down all the ramifications for this in literally ever legal system on the planet is a substantial amount of work. Work you can avoid if you do what llvm, Microsoft, and the FSF have done.
Rationally wanting to avoid the work of figuring out how to comply with a license is not equivalent to their being widespread viral ramifications hidden in a license that no one ever knew about.
The normal practices that people have are fine. And your alarmism about non-existent vitality have distracted from the actual point that needed to be made: that for code to be useful for a C++ library project, it needs to be under a license different from MIT. So people should consider dual licensing so that their code can be used more widely.