Click here to Skip to main content
15,886,565 members
Articles / Programming Languages / C++

Adhering to a Silly Rule

Rate me:
Please Sign up or sign in to vote.
3.80/5 (6 votes)
1 May 2021CPOL1 min read 8K  
A function may only return from its last line!
Some coding standards insist that a function only return at its end. However, there is a way to simplify the convoluted code that this often produces.

Views

Daily Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect
United States United States
Author of Robust Services Core (GitHub) and Robust Communications Software (Wiley). Formerly Chief Software Architect of the core network servers that handle the calls in AT&T's wireless network.

Comments and Discussions