Skip to content
Snippets Groups Projects
Commit d1829197 authored by Olivier Dion's avatar Olivier Dion Committed by Adrien Béraud
Browse files

agent/utils: Add from_guile()::operator uint8_t()

Change-Id: I00df0524c8b00ad55fffe1ab17e82ba8a8ee9c0a
parent 282a5e62
Branches
Tags
No related merge requests found
......@@ -138,6 +138,13 @@ struct from_guile
return scm_to_bool(value);
}
operator uint8_t()
{
ensure_type("uint8", [](SCM v){ return scm_is_unsigned_integer(v, 0, 255); });
return scm_to_int(value);
}
operator int()
{
ensure_type("integer", scm_is_integer);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment