3 ms·
The right thing is what is here being called a "bound pointer". It is actually the correct implementation of a closure: a code pointer paired with a data point
by ScottBurson 14y ago
The right thing is what is here being called a "bound pointer". It is actually the correct implementation of a closure: a code pointer paired with a data pointer, where only the code in question needs to know the type of the data pointer.
I proposed it to Stroustrup et al. in 1992, but was ignored.
I don't recall their rationale for rejecting it, but I think time has borne me out.
- scott_s 14y agoI know from D&E that the C++ committee has a policy of only accepting new features which had an existing implementation and first-hand accounts of using the feature.
- mkup 14y agoThere was existing implementation in 90s, bound pointers were implemented in Borland C++ Builder (__closure keyword).
- scott_s 14y agoThen I think it's fair to assume the above poster was not the only person to propose it.
- ScottBurson 14y agoI probably wasn't the only one proposing it, but I have no way to know who else might have done so.