Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template <class data_type>
- void sequence<data_type>::attach(data_type value){
- if(used == capacity){
- resize(used+1);
- }
- if(current_index >= used){
- start();
- advance();
- advance();
- }
- if(used!=0){
- for(int i = used; i > current_index+1; i--){
- data[i] = data[i-1];
- }
- data[current_index+1] = value;
- current_index++;
- }
- data[current_index] = value;
- ++used;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement