A reference is always bound to an object. In fact, you can think of a reference variable as an alias of its bound object. However, void& is not bound to any object at all and is therefore illegal.
Home » Why void& Type is Illegal
A reference is always bound to an object. In fact, you can think of a reference variable as an alias of its bound object. However, void& is not bound to any object at all and is therefore illegal.
At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.
See our full editorial policy.