Home Help Center

nullable slice definitions?

filgoodfilgood Member Filip WuytackOrganization: JS CapitalProject: financial middleware

I'm unable to find in the documentation how to define nullable types in slice. Can someone please show my an example?

Ideally I would like to end up with a

public int? myint; in c#

Many thanks,



  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff

    It's not possible to specify nullable types with Slice and map them to C# nullables.

    Ice 3.5 (currently in beta) will provide "optional" members and parameters which you could eventually use instead to specify nullables. Optionals are not mapped to nullables types in C# however. See here for more information on the C# mapping of Slice optionals.

    Another possibility is to map the nullable types to Slice classes, for example:
    // Slice
    class NullableInt 
        int value;   

Sign In or Register to comment.