Re: [Vala] Ternary operator and nullable values in return statements
- From: Dru Moore <dru dru-id co uk>
- To: Jiří Zárevúcky <zarevucky jiri gmail com>
- Cc: vala-list gnome org
- Subject: Re: [Vala] Ternary operator and nullable values in return statements
- Date: Sun, 28 Nov 2010 19:03:34 +0000
2010/11/28 Jiří Zárevúcky <zarevucky jiri gmail com>:
You need to cast it like this:
(0 == number) ? null : (int?) 1
or
int? i = 1;
(0 == number) ? null : i
Thank you. That's it of course.
cheers
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]