Guest User

Untitled

a guest
Jul 17th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. use std::marker::PhantomData;
  2. trait Lolka {}
  3.  
  4. pub struct LolkaImpl;
  5.  
  6. impl Lolka for LolkaImpl {}
  7.  
  8. struct Instance<CFG=LolkaImpl> {
  9. _temp: PhantomData<CFG>
  10. }
  11.  
  12. impl<CFG: Lolka> Instance<CFG> {
  13. pub fn new() -> Instance<CFG> {
  14. Self {
  15. _temp: PhantomData
  16. }
  17. }
  18. }
  19.  
  20. fn main() {
  21. let test = Instance::new();
  22. }
Add Comment
Please, Sign In to add comment