Thank you for the suggestions!
I don't think you are describing a way to deal with SFINAE (std::enable_if constraints). I think you are suggesting two things:
As far as calling C++ function templates from Swift generics, the primary difficulty with your suggestion is that specializations of C++ function templates will not be picked up. Consider what happens when we call maximumValue with T=SomeCppClass. ::max could have a user-defined specialization ::max<SomeCppClass>, but instead interop will call ::max< Swift::Bridge<Swift::CustomSwiftProtocol>>.
Another difficulty is that mapping Comparable to Swift::CustomSwiftProtocol as shown above is not fully safe. C++ does not have an equivalent of Swift's Self in protocol definition. Therefore, C++ code can pass mismatched arguments to operator< and it would still compile. It would be possible to detect the error at runtime, but it is important to keep in mind that the mapping is not as straightforward.
I think this is a very interesting direction, but I think first we should discuss how to export simpler Swift types to C++, like plain structs and classes, and how to map their protocol conformances. Once we have these building blocks, we will explore how they compose with templates.
I think that would imply that std::string would have to be backed by a copy-on-write buffer, which is prohibited by the C++ standard since C++11.
Also I think that a significant number of C++ users would be unhappy about atomic reference counting and copy-on-write semantics in value types like std::string and std::vector. COW and ARC maybe could have been very reasonable ways to implement data structures in C++, but since C++ implementations have not been doing that (or even actively stopped doing it since C++11), I am certain that changing eagerly-copying data types into COW and ARC based data types will significantly degrade performance in lots of C++ code.
I'm not sure what makes you say that: many compilers and standard libraries do guarantee ABI stability. libc++ on MacOS, iOS and Linux is ABI-stable, and so is libstdc++. GCC and Clang both implement the Itanium ABI and are link-compatible. Clang also implements the MSVC ABI and is link-compatible with code produced by the Visual Studio compiler. These are not just theoretical arguments, many real systems are built on top of them (e.g., most Linux distributions, as well as MacOS and iOS). You can also look at the amount of pain Linux distributions experienced when libstdc++ had to break the ABI for std::string due to C++11 changes.
I wish we could handwave the ABI issues and tell everyone to vendor their C++ standard library. While some people can do that, a significant number of users lives in a very different world that depends on a stable ABI in the C++ standard library.
The question actually goes beyond ABI stability -- it goes into being able to rebuild from source all C++ code that the user wishes to load into the process. There are significant difficulties with loading two C++ standard libraries into one process. People will run into these difficulties if they want to depend on some system library (or a library that is distributed as a compiled binary) that loads the C++ standard library from the system, and on Swift/C++ interop that will depend on the Swift-specific C++ standard library.
I think that making Swift and C++ standard libraries cooperate is a very interesting and possibly very rewarding direction, but we must ensure that stuff that works today continues to work the same way when Swift/C++ interop is enabled. Sure, if enough users of Swift/C++ interop can vendor a C++ standard library, and breaking the ABI of the C++ standard library helps significantly enough to warrant maintenance costs (maintaining a custom C++ standard library is a huge effort), it would be an important optimization, but it won't work for every user of Swift. Therefore, we have to implement the general solution first.