refactor: use as_xxx instead of cast<enum>
refactor: use as_xxx instead of cast<enum>

because cast<enum>() requires `template` specifier inside a template
function. it makes code long.

ToruNiina/toml11