Skip to content

Example of returning an error code and return value from C++ functions via templating

Notifications You must be signed in to change notification settings

rb12345/cpp_annotated_return

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

C++ Annotated Return Example

This code is intended as an example of one way to return both an error code and return value from a C++ function. This is done via a templated struct type AnnotatedReturn<T,V> {T errorCode;V returnValue;}. This could also be done via a class, which may be cleaner depending on your point of view (since the constructor can populate both values).

About

Example of returning an error code and return value from C++ functions via templating

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages