nullable slice definitions?

filgoodfilgood Filip WuytackOrganization: JS CapitalProject: financial middlewareMember
Hi,

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,

Filip

Comments

  • benoitbenoit Rennes, FranceBenoit FoucherOrganization: ZeroC, Inc.Project: IceAdministrators, ZeroC Staff ZeroC Staff
    Hi,

    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;   
    };
    

    Cheers,
    Benoit.
Sign In or Register to comment.