Bug 17350 – bitmanip checks min, while Ternary does not have this property

Status
NEW
Severity
normal
Priority
P3
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Mac OS X
Creation time
2017-04-26T09:17:26Z
Last change time
2024-12-01T16:30:10Z
Assigned to
No Owner
Creator
Alex
Moved to GitHub: phobos#10249 →

Comments

Comment #0 by sascha.orlov — 2017-04-26T09:17:26Z
Trying this import std.bitmanip; import std.typecons; void main(){} struct S1 { mixin(taggedPointer!( Val*, "vv", bool, "b1", 1, bool, "b2", 1, bool, "b3", 1)); } struct S2 { mixin(taggedPointer!( Val*, "vv", ubyte, "t", 3)); } struct S3 { mixin(taggedPointer!( Val*, "vv", Ternary, "t", 3)); } struct Val { size_t dummy; } I got an error: bitmanip.d(94,20): Error: no property 'min' for type 'Ternary' bitmanip.d(127,20): Error: no property 'min' for type 'Ternary' bitmanip.d(183,15): Error: template instance std.bitmanip.createAccessors!("_vv_t", Ternary, "t", 3LU, 0LU) error instantiating bitmanip.d(243,11): instantiated from here: createFields!("_vv_t", 0LU, Ternary, "t", 3, ulong, "", 61LU) bitmanip.d(314,26): instantiated from here: createTaggedReference!(Val*, 8LU, "vv", Ternary, "t", 3) test62.d(17,8): instantiated from here: taggedPointer!(Val*, "vv", Ternary, "t", 3) I understand, that it is not possible to order a Ternary without implifications. However, as the size allows it, it should be possible to use it as a pointer discriminator.
Comment #1 by robert.schadek — 2024-12-01T16:30:10Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/10249 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB