Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
src_corelib_tools_qscopeguard.cpp
Go to the documentation of this file.
1// Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Sérgio Martins <sergio.martins@kdab.com>
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
6{
7 // The lambda will be executed right before your function returns
8 auto cleanup = qScopeGuard([] { code you want executed goes HERE; });
9
10 if (v == -1)
11 return;
12
13 int v2 = code_that_might_throw_exceptions();
14
15 if (v2 == -1)
16 return;
17
18 (...)
19}
GLint GLfloat GLfloat GLfloat v2
GLsizei const GLfloat * v
[13]
QScopeGuard< typename std::decay< F >::type > qScopeGuard(F &&f)
[qScopeGuard]
Definition qscopeguard.h:60
void myComplexCodeWithMultipleReturnPoints(int v)
[0]