[C++17] Inline Variable
Pattern
inline auto var =
[value]
;
Description
C++ consist a lot of source files. They are compiled, linked into single binary file. When linking, it occurs error when you defined some symbols multiple time. The traditional solution is to declare symbol in the header files, then the definition will be done once for each source file which has included the header files. This is called One Definition Rule. In C++17, there is another way to solve this. inline
keyword can be in front of variables. Compiler can implement variables by inline keyword, which the variable will be redefined where it is called.