Compile-time checks and safer raw wrapper