File: splitbase.cc

package info (click to toggle)
xd 5.00.03-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 708 kB
  • sloc: cpp: 1,852; fortran: 161; makefile: 107; sh: 36; ansic: 30
file content (19 lines) | stat: -rw-r--r-- 409 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "command.ih"

    // by command1.cc

void Command::splitBase()
{
    if (size() != 1)
        return;

    for_each(                   // copy all spec. elements into Command's 
        front().begin() + 1, front().end(),                 // base object
        [&](char ch)
        {
            push_back(string(1, ch));
        }
    );

    front().resize(1);          // keep the 1st character
}