Different struct sizes
Posted: Sun Jul 07, 2013 11:47 am
Why does an empty struct have a size of 4 and not 1 like in C#?
Discussion about the Cobra programming language.
http://cobra-language.com/forums/
int _ih_invariantGuard;
"""
cobra -c -keep-intermediate-files empty-struct.cobra
cobra -c -keep-intermediate-files -contracts:none empty-struct.cobra
"""
struct S
pass
class P
def main
pass
hopscc wrote:Charles:
Slightly related:
with -contracts:methods is it intentional that both calls to the synthesized require/ensure contract methods and (possibly empty) contracts methods themselves are always generated (even if no contracts are given)?
The default inline version at least has some optimising out for non-existant contracts calls.
Chasm wrote:And couldn't you make it "DependencyProperty"-esque? Basically a static dictionary of <int, int>? The object's address would be the key and the value would be the check int?