A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/bytedeco/javacpp/issues/388 below:

bool not correctly parsed · Issue #388 · bytedeco/javacpp · GitHub

Javacpp is not translating the cpp boolean enums correctly. Here is the enum defined in cpp

enum class null_order : bool {
  AFTER,  ///< NULL values ordered *after* all other values
  BEFORE  ///< NULL values ordered *before* all other values
};

without info.enumerate() it gets translated to

public static final boolean
  /** NULL values ordered *after* all other values */
  AFTER = 0,
  /** NULL values ordered *before* all other values */
  BEFORE = 1;

with enumerate() the following is the output.

@Namespace("cudf") public enum null_order {
  /** NULL values ordered *after* all other values */
  AFTER(0),
  /** NULL values ordered *before* all other values */
  BEFORE(1);

    public final boolean value;
    private null_order(boolean v) { this.value = v; }
    private null_order(null_order e) { this.value = e.value; }
    public null_order intern() { for (null_order e : values()) if (e.value == value) return e; return this; }
    @Override public String toString() { return intern().name(); }
}

In both cases it is trying to assign an int value to a boolean. How can we get this to correctly generate the code?


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4