return val;
`}
# Uses a callback to report when receiver is empty
fun safe_pop_with_default(default_return: Int): Int import report_error in "C++" `{
return val;
`}
# Uses a callback to report when receiver is empty
fun safe_pop_with_default(default_return: Int): Int import report_error in "C++" `{
# Prints the given string when receiver is empty
fun safe_pop_with_custom_error(default_return: Int, error_msg: String): Int import String.to_cpp_string in "C++" `{
# Prints the given string when receiver is empty
fun safe_pop_with_custom_error(default_return: Int, error_msg: String): Int import String.to_cpp_string in "C++" `{