ํŠœํ”Œ

fn main() {
    let t: (i8, bool) = (7, true);
    println!("t.0: {}", t.0);
    println!("t.1: {}", t.1);
}
This slide should take about 5 minutes.
  • ๋ฐฐ์—ด๊ณผ ๋งˆ์ฐฌ๊ฐ€์ง€๋กœ ํŠœํ”Œ์€ ๊ณ ์ • ๊ธธ์ด๋ฅผ ๊ฐ–์Šต๋‹ˆ๋‹ค.

  • ํŠœํ”Œ์€ ์„œ๋กœ ๋‹ค๋ฅธ ํƒ€์ž…์˜ ๊ฐ’๋“ค์„ ํ•˜๋‚˜์˜ ๋ณตํ•ฉ ํƒ€์ž…์œผ๋กœ ๋ฌถ์Šต๋‹ˆ๋‹ค.

  • ํŠœํ”Œ์— ์†ํ•œ ๊ฐ’์€ t.0, t.1๊ณผ ๊ฐ™์ด ์ธ๋ฑ์Šค๋กœ ์ ‘๊ทผํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

  • The empty tuple () is referred to as the โ€œunit typeโ€ and signifies absence of a return value, akin to void in other languages.