SSoelvsten / adiar

An I/O-efficient implementation of (Binary) Decision Diagrams
https://ssoelvsten.github.io/adiar/
MIT License
24 stars 13 forks source link

Incompatible types in ternaries: 'bdd' and '__bdd' #103

Closed SSoelvsten closed 3 years ago

SSoelvsten commented 3 years ago

The bdd and __bdd classes work really well to completely hide the file management, and garbage collection from both the clients and the developers point of view. The copy-constructor of the bdd class does not kick in though in ternaries.

bdd a = bdd_ithvar(0);
bdd b = bdd_nithvar(1);
bdd c = a == b ? a : bdd_xor(a,b);

Will give an "operands to ?: have different types ‘adiar::bdd’ and ‘adiar::__bdd" error.

SSoelvsten commented 3 years ago

One can make it work as follows:

bdd a = bdd_ithvar(0);
bdd b = bdd_nithvar(1);
bdd c = a == b ? __bdd(a) : bdd_xor(a,b);