Quuxplusone added a comment.

I should add that if any particular library really wants to //enforce// "thou 
shalt not deep-link <https://en.wikipedia.org/wiki/Deep_linking> detail 
headers" (instead of just documenting it and/or relying on the 
user-programmer's common sense) they can do it pretty cleanly via macros:

  // toplevel.h
  #pragma once
  #define DONT_INCLUDE_DETAIL_HEADERS_DIRECTLY(x, y)
  #include <__utility/foo.h>
  #include <__various/bar.h>
  #undef DONT_INCLUDE_DETAIL_HEADERS_DIRECTLY
  // more code here

and then

  // __utility/foo.h
  #pragma once
  DONT_INCLUDE_DETAIL_HEADERS_DIRECTLY(instead, include <utility>)
  class Foo {};
  void foo();

I don't know how you'd achieve a similar effect with C++20 Modules, but I 
certainly hope it's possible somehow.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105439/new/

https://reviews.llvm.org/D105439

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to