[Cs3] no, you cannot reassign (rebind) a reference, or can you?

Mikhail Nesterenko mnestere at kent.edu
Thu Aug 27 15:43:23 EDT 2026


CS3 students,

This is from today's lecture on references. Officially you are not
allowed to reassign a reference. After

	int &b = a;

reference "b" will always be assigned or bound to "a". However, C++26,
the brand new standard, suggests an alternative: So called optional
references. Here is a link for the curious:

	https://www.reddit.com/r/cpp/comments/1pfk0ox/where_is_stdoptionalt/

Thanks,
-- 
Mikhail


More information about the cs3 mailing list