Archived

This forum has been archived. Please start a new discussion on GitHub.

Support flags in slice

In the slice can be define enum by keyword enum. But how to define a slice flags? Do you do planned support flags in next version Ice?

Comments

  • xdm
    xdm La Coruña, Spain
    You can map your flags to Slice constants
  • How to define Flags in Slice

    Thank you for your answer, but your solution is not suitable for my purposes.
    I found the solution on their own.

    In version 3.6 it was possible to add attributes to the slice:
    ["cs:attribute:System.Flags"]
    enum MyTestFlag 
    {
        First,
        Second,
        Third
    };
    
    Then I get what I need:
    [System.Flags]
    [_System.CodeDom.Compiler.GeneratedCodeAttribute("slice2cs", "3.6b")]
    public enum MyTestFlag
    {
        First,
        Second,
        Third
    }