[libcxx-commits] [libcxx] [libc++][print] Adds ostream overloads. (PR #73262)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Dec 12 09:44:11 PST 2023


================
@@ -256,6 +256,8 @@ public:
     inline static const char*
     __make_mdstring(ios_base::openmode __mode) _NOEXCEPT;
 
+    _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI FILE* __file() { return __file_; }
----------------
ldionne wrote:

I think I would rather befriend the function that needs to access `__file_` here, since this is an invitation for users to get the underlying file descriptor and we want to make that as difficult as possible. Basically making the function a friend makes us less vulnerable to Hryum's law.

https://github.com/llvm/llvm-project/pull/73262


More information about the libcxx-commits mailing list