Mantis 339

Commas in queue ranges should be colons

P1800-2008/D3a, Section 7.11.1, 7.11.2

In Section 7.11.1

CHANGE

 

q = { q[0:pos-1], e, q[pos,$] }; // insert 'e' at position pos
q = { q[0:pos], e, q[pos+1,$] }; // insert 'e' after position pos

TO

q = { q[0:pos-1], e, q[pos,:$] }; // insert 'e' at position pos
q = { q[0:pos], e, q[pos+1,:$] }; // insert 'e' after position pos

 

CHANGE Section 7.11.2.2-7.11.2.5

 

7.11.2.2 Insert()

The prototype of the insert() method is as follows:

function void insert(input int index, input element_t item);

The insert() method inserts the given item at the specified index position.

Q.insert(i, e) is equivalent to: Q = {Q[0:i-1], e, Q[i,$]}

 

7.11.2.3 Delete()

The prototype of the delete() method is as follows:

function void delete(int index);

The delete() method deletes the item at the specified index position.

Q.delete(i) is equivalent to: Q = {Q[0:i-1], Q[i+1,$]}

 

7.11.2.4 Pop_front()

The prototype of the pop_front() method is as follows:

function element_t pop_front();

The pop_front() method removes and returns the first element of the queue.

e = Q.pop_front() is equivalent to: e = Q[0]; Q = Q[1,$]

 

7.11.2.5 Pop_back()

The prototype of the pop_back() method is as follows:

function element_t pop_back();

The pop_back() method removes and returns the last element of the queue.
e = Q.pop_back() is equivalent to: e = Q[$]; Q = Q[0,$-1]

 

TO

 

7.11.2.2 Insert()

The prototype of the insert() method is as follows:

function void insert(input int index, input element_t item);

The insert() method inserts the given item at the specified index position.

Q.insert(i, e) is equivalent to: Q = {Q[0:i-1], e, Q[i,:$]}

 

7.11.2.3 Delete()

The prototype of the delete() method is as follows:

function void delete(int index);

The delete() method deletes the item at the specified index position.

Q.delete(i) is equivalent to: Q = {Q[0:i-1], Q[i+1,:$]}

 

7.11.2.4 Pop_front()

The prototype of the pop_front() method is as follows:

function element_t pop_front();

The pop_front() method removes and returns the first element of the queue.

e = Q.pop_front() is equivalent to: e = Q[0]; Q = Q[1,:$]

 

7.11.2.5 Pop_back()

The prototype of the pop_back() method is as follows:

function element_t pop_back();

The pop_back() method removes and returns the last element of the queue.
e = Q.pop_back() is equivalent to: e = Q[$]; Q = Q[0,:$-1]