TGViewer
C++ - Reddit C++ - Reddit @r_cpp · 230 subscribers
Post #25098 18
Syntactic sugar of member function binding?

Instead of

std::bind_front(&Very::Long::Namespace::VeryLongClassName::method, pobject)


I'm currently using

#define BIND_FRONT(method, pobject) std::bind_front(&std::remove_cvref_t<decltype(*(pobject))>::method, (pobject))

BIND_FRONT(method, pobject)


I wonder if we can make

(pobject->method)


or

((*pobject).method)


or

((*pobject)::method)


a syntactic sugar of

BIND_FRONT(method, pobject) // a.k.a `std::bind_front(&std::remove_cvref_t<decltype(*(pobject))>::method, (pobject))`


Possible? Any drawbacks?

https://redd.it/1t0gryo
@r_cpp
Reddit From the cpp community on Reddit Explore this post and more from the cpp community
More from @r_cpp
  1. Oct 4, 2026PJ Plauger's final column at C/C++ Users Journal (2000) https://jacobfilipp.com/DrDobbs/ar…
  2. Oct 4, 2026Why C++ is so hated!!! I love C++. High level + low level at the same time. But Linus Torv…
  3. Oct 4, 2026About alignment, struct layout and the cache... https://meetingcpp.com/blog/items/About-al…
  4. Oct 4, 20260x40: Intro, NB and C++ news, the 10 year anniversary , and the Quiz https://youtu.be/cEjc…
  5. Oct 4, 2026Packing Binary Is Fun, Actually https://hereticpleb.vercel.app/blog/packing-binary-is-fun-…
  6. Oct 3, 2026I've tried "Token Sequence Injection & Modern Macros" and here are my thoughts We had this…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →