-

   rss_forum_sources_ru

 - e-mail

 

 -

 LiveInternet.ru:
: 29.07.2007
:
:
: 80

:


, 27 2021 . 12:14 +
OpenGL: , .. , BC " mut ". , .. , mut, Cell:
    use std::cell::Cell;
    struct Foo
    {
    field: Cell,
    }
    impl Foo
    {
    fn new() -> Self
    {
    Foo{field: Cell::new(42)}
    }
    }
    fn main() {
    //
    let f = Foo::new();
    println!("{:?}", f.field.get());
    f.field.set(-42);
    // ,
    println!("{:?}", f.field.get());
    }

:
    42
    -42

https://forum.sources.ru/index.php?showtopic=421266&view=findpost&p=3846851

:  

: [1] []
 

:
: 

: ( )

:

  URL