Новые блоки создаются во всех уже сгенерированных. Хотя объекты же разные.
rootElement, и в конструктор передавать блок, к которому CategoryManager привязан, а класс уже переписать в следующем виде:class CategoryManager {
    constructor(rootElement) {
        this.rootElement= rootElement;
        this.currentCounter = this.rootElement.find('.category-card').length + 1;
    }
    render(categoryBlock) {
        this.categoryHtml = categoryBlock;
        this.rootElement.find(".categories-content").append(this.categoryHtml);
        this.currentCounter = this.rootElement.find('.category-card').length;
    }
    getCounter() {
        return this.currentCounter;
    }
    addSubcategory() {
        this.rootElement.find('.category-card__subblock-' + this.getCounter()).append(addSubCategory());
        console.log(this.getCounter());
    }
}#include <map>
#include <vector>
#include <string>
using namespace std;
int main() {
    typedef map <string, int> MapType;
    MapType m;	
    vector <int> v;
    //заполняем m как-то
    for( MapType::iterator it = m.begin(); it != m.end(); ++it ) {
    	v.push_back( it->second ); // помещаем в вектор необходимое поле. В данном случае it->second - значение int для строки
    }
}#include <iostream>
#include <string>
#include <fstream>
#include <sstream>
#include <vector>
#include <deque>
#include <map>
#include <thread>
#include <mutex>
std::mutex mutex;
std::string files[4] =
        {
                "file1.txt",
                "file2.txt",
                "file3.txt",
                "file4.txt"
        };
void pipeline(std::string &in, std::vector<std::string> &str)
{
	std::lock_guard<std::mutex> lock(mutex);
	std::ifstream file;
	file.open(in);
    while (!file.eof())
    {
        std::string temp;
        std::getline(file, temp);
        str.push_back(temp);
    }
	std::cout << in << " finished" << std::endl;
	file.close();
}
int main()
{
    std::string string;
    std::vector<std::string> str;
    std::map<std::string, std::size_t> freq;
    std::deque<std::thread> pool;
    std::ofstream out("out.txt");
    for (std::size_t i = 0; i < 4; i++)
    {
        pool.push_back(std::thread(pipeline, std::ref(files[i]), std::ref(str)));
    }
    while (pool.size())
    {
        pool.front().join();
        pool.pop_front();
    }
	out << str.size();
	std::cout << str.size();
	std::cin.get();
    return 0;
} 
  
  #include <algorithm>
#include <iostream>
#include <string>
#include <map>
std::string str[3] = { "foo bar", "baz quux", "x y" };
std::map<std::string, std::string> d;
for (auto const & s : str)
{
	auto it = s.find(' ');
	if (it != std::string::npos)
		d[s.substr(0, it)] = s.substr(it + 1);
}
for (auto const & kv : d)
	std::cout << kv.first << " = " << kv.second << std::endl;#include <string>
#include <algorithm>
#include <map>
#include <iostream>
int main()
{
	std::vector<std::string> d {"hello world"};
	std::map<std::string, std::string> m;
	std::for_each(d.cbegin(), d.cend(), [&m](const std::string& v){ auto pos = v.cbegin() + v.find(" "); 
		m.emplace(std::string(v.cbegin(), pos), std::string(std::next(pos), v.cend()));});
	std::cout << m.cbegin()->first << "\n" << m.cbegin()->second << "\n";
}