i = i++; // Это было неопределённым поведением до C++17
i = ++i; // А это было неопределённое поведение до C++11
p[i] = i++; // Это было неопределённым поведением до C++17
Group {
name: "cpp_os_specific"
prefix: "src/cpp/utils/"
files: {
if (qbs.targetOS.contains("windows"))
return ["utils_windows.cpp", "utils.h"];
if (qbs.targetOS.contains("linux"))
return ["utils_linux.cpp", "utils.h"];
}
}
import qbs 1.0
Product {
type: "application"
name: "timer_qml"
consoleApplication: false
Group {
name: "cpp"
prefix: "src/cpp/"
files: ["*.cpp", "*.h"]
}
Group {
name: "cpp_os_specific"
prefix: "src/cpp/utils/"
files: {
if (qbs.targetOS.contains("windows"))
return ["utils_windows.cpp", "utils.h"];
if (qbs.targetOS.contains("linux"))
return ["utils_linux.cpp", "utils.h"];
}
}
Group {
name: "resources_and_qml"
prefix: "src/qrc/"
files: ["*.qrc", "*.qml"]
}
Depends {
name: "Qt"
submodules: {
if (qbs.targetOS.contains("windows"))
return ["core", "widgets", "gui", "sql", "quick", "qml"];
if (qbs.targetOS.contains("linux"))
return ["core", "widgets", "gui", "sql", "quick", "qml", "x11extras"];
}
}
Depends {
name: "cpp"
}
cpp.staticLibraries: {
if (qbs.targetOS.contains("windows"))
return ["user32"];
else
return [];
}
cpp.cxxFlags: {
if (qbs.toolchain.contains("gcc") || qbs.toolchain.contains("mingw"))
return ["-std=c++11"];
else
return [];
}
cpp.dynamicLibraries: {
if (qbs.targetOS.contains("linux"))
return ["Xss", "X11"];
else
return [];
}
Group {
name: "App itself"
fileTagsFilter: parent.type
qbs.install: true
qbs.installDir: "bin"
}
}
The value obtained by applying a postfix ++ is the value that the operand had before applying the operator. [Note: the value obtained is a copy of the original value ] The operand shall be a modifiable lvalue. The type of the operand shall be an arithmetic type or a pointer to a complete object type. After the result is noted, the value of the object is modified by adding 1 to it, unless the object is of type bool, in which case it is set to true. [Note: this use is deprecated, see annex D. ]
www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p...
"The ++ operator for bool was deprecated in the original 1998 C++ standard, and it is past time to formally remove it.
int main(int argc, char *argv[])
{
ttt *t = new ttt();
t->foo();
delete t;
t->foo();
return 0;
}