void apply_version()

in include/poac/core/semver.hpp [177:201]


        void apply_version(const std::smatch& sm) {
            const auto is_matched = [](const auto& m){ return m.matched; };
            const auto count = std::count_if(sm.begin(), sm.end(), is_matched);

            // X.Y.Z-B1.B2+P1.P2.P3
            switch (count) {
                case 6: // build meta data ([P1, P2, P3])
                    build = split(sm[5].str(), '.');
                    [[fallthrough]];
                case 5: // pre-release version ([B1, B2])
                    pre = split(sm[4].str(), '.');
                    [[fallthrough]];
                case 4: // patch version (Z)
                    patch = std::stoull(sm[3].str());
                    [[fallthrough]];
                case 3: // minor version (Y)
                    minor = std::stoull(sm[2].str());
                    [[fallthrough]];
                case 2: // major version (X)
                    major = std::stoull(sm[1].str());
                    [[fallthrough]];
                default:
                    break;
            }
        }