Thought Leadership

Video about C++ reference parameters

My latest video blog is now available. This time I am looking at reference parameters in C/C++ and how they can reduce errors with pointer manipulation, but perhaps at the cost of code readability. You can see the video here or here:

Future video blogs will continue to look at topics of interest to embedded software developers. Suggestions for topics are always welcome via comment, email or social networking.

Colin Walls

I have over thirty years experience in the electronics industry, largely dedicated to embedded software. A frequent presenter at conferences and seminars and author of numerous technical articles and two books on embedded software, I am a member of the marketing team of the Mentor Graphics Embedded Systems Division, and am based in the UK. Away from work, I have a wide range of interests including photography and trying to point my two daughters in the right direction in life. Learn more about Colin, including his go-to karaoke song and the best parts of being British: http://go.mentor.com/3_acv

More from this author

Comments

2 thoughts about “Video about C++ reference parameters
  • Or you could code in a const safe manner.

    If the parameter isn’t a constant, reference or pointer, it can be changed.

    It’s self documenting that swap( int &, int &) can change both parameters… Where as swap( const int &, const int &) can not change them

    For complex types, non POD, the cost of an accidental deep copy, when you simply need the value makes const reference parameters crucial to high speed software development.

Leave a Reply

This article first appeared on the Siemens Digital Industries Software blog at https://blogs.sw.siemens.com/embedded-software/2018/03/26/video-about-c-reference-parameters/