Greeks solved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"errors" | |
"fmt" | |
"sync" | |
"time" | |
"github.com/google/uuid" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Расскожите про коцнепция владение. Что такое передача владениям (move semantic)? | |
https://stackoverflow.com/questions/30288782/what-are-move-semantics-in-rust | |
2. Расскажите про трейты Copy, Clone. | |
3. Расскажите про управление памятью. | |
Време жизни обьекта? | |
Что такое анотация лайфтаймов? | |
Что такое умные узатели, зачем они нужные? | |
4. Send + Sync | |
5. Async | |
6. Inner mutability |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![feature(fn_traits, unboxed_closures)] | |
// Overloaded functions in Rust! | |
fn main() { | |
assert_eq!(my_func(12usize), 12u64); | |
assert_eq!(my_func(3u8, 4u8), 7u16); | |
assert_eq!(my_func(5usize, 7usize), true); | |
assert_eq!(my_func(51u8), "51".to_owned()); | |
assert_eq!(my_func(), &["test"]); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<typename T> | |
struct variable_t { | |
T value; | |
}; | |
using fd_int = variable_t<int>; | |
using fd_float = variable_t<float>; | |
using fd_char = variable_t<char>; | |
// Needed memory optimization, now we haw summ top wich have lagest size for all type |