Re: [go-nuts] Static assert at compile time

2018-10-27 Thread David Collier-Brown
In the special case of versioning, think about implementing "updaters" or "downdaters" on receipt of a versioned object/struct, as in https://leaflessca.wordpress.com/2017/02/12/dll-hell-and-avoiding-an-np-complete-problem/ For other uses, if you describe them here, we might be able to make a

Re: [go-nuts] Static assert at compile time

2018-10-27 Thread hay
Hi robert, I'm looking for something C/C++ like static assertion to check few things at compile time. Hi Ian, thanks for the reply. It is checking at init at the moment. It is basically string or/and version checks. I'll give simple example. In C++ it will be something like this. class Foo {

Re: [go-nuts] Static assert at compile time

2018-10-27 Thread Ian Denhardt
It's a little unclear to me what exactly you're trying to check; giving an example might make it easier to advise. But in any case, Go doesn't have anything quite like static_assert in C/C++. Depending on what you're trying to do, you could put a call to panic in an init() function, which would

Re: [go-nuts] Static assert at compile time

2018-10-27 Thread robert engels
I don’t think it is possible in any language - I think it is a very of the halting problem https://en.wikipedia.org/wiki/Halting_problem unless you are referring to checking a constant ? > On Oct 27, 2018, at 5:07 PM, hay wrote: > > Hi, > >

[go-nuts] Static assert at compile time

2018-10-27 Thread hay
Hi, I've a project and it needs static asserts at compile time to check if string values are not left empty by the programmer. Is this possible in golang? Thanks in advance -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from