mirror of https://github.com/sunface/rust-course
				
				
				
			
			You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					11 lines
				
				440 B
			
		
		
			
		
	
	
					11 lines
				
				440 B
			| 
								 
											4 years ago
										 
									 | 
							
								# 泛型
							 | 
						||
| 
								 
											4 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 
											4 years ago
										 
									 | 
							
								泛型的主旨是把类型和函数泛化到多种情况。
							 | 
						||
| 
								 | 
							
								这在很多方面有助于减少重复代码,但也可能需要为此使用相当多的语法。
							 | 
						||
| 
								 | 
							
								也就是说,使用泛型的话则需要小心谨慎地标明泛型适用于哪些类型。
							 | 
						||
| 
								 
											4 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 
											4 years ago
										 
									 | 
							
								## 更多信息
							 | 
						||
| 
								 
											4 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 | 
							
								- [Generic Data Types](https://doc.rust-lang.org/stable/book/ch10-01-syntax.html)
							 | 
						||
| 
								 | 
							
								- [Bounds](https://doc.rust-lang.org/rust-by-example/generics/bounds.html)
							 |