Crash occurs if the user attempts to use a range and the source of the range has gone out of scope. #132
		
			
				
	
	
		
			11 lines
		
	
	
		
			195 B
		
	
	
	
		
			ChaiScript
		
	
	
	
	
	
			
		
		
	
	
			11 lines
		
	
	
		
			195 B
		
	
	
	
		
			ChaiScript
		
	
	
	
	
	
auto x = [1, 2, 3, 4]
 | 
						|
auto r = range(x)
 | 
						|
r.pop_front()
 | 
						|
assert_equal(2, r.front());
 | 
						|
 | 
						|
// test with temporary vector for range
 | 
						|
auto q = range([1, 2, 3, 4])
 | 
						|
q.pop_front()
 | 
						|
assert_equal(2, q.front());
 | 
						|
 |