Boost multi-index based orderbook As suggested here, I'm using Boost multi-index to implement orderbook. So far my code looks like this:

"CommonsNative.h" contains typedef int64_t myDecimal; and enum Side { Buy, Sell };

#pragma once

#include "CommonsNative.h"
#include &lt;boost/multi_index_container.hpp&gt;
#include &lt;boost/multi_index/member.hpp&gt;
#include &lt;boost/multi_index/ordered_index.hpp&gt;
#include &lt;boost/multi_index/hashed_index.hpp&gt;

using boost::multi_index_container;
using namespace boost::multi_index;

struct OrderBookItem {
    myDecimal price;
    int32_t lots;
    OrderBookItem(myDecimal price_) :price(price_), lots(0) {

    }
};

typedef multi_index_container
    &lt;OrderBookItem, indexed_by&lt;

    hashed_unique&lt;
    BOOST_MULTI_INDEX_MEMBER(OrderBookItem,myDecimal,price)
    &gt;,

    ordered_unique&lt;
    BOOST_MULTI_INDEX_MEMBER(OrderBookItem,myDecimal,price),
    std::greater&lt;myDecimal&gt; /* sorted beginning with most frequent */
    &gt;

    &gt;&gt; OrderBookContainer;

class OrderBook
{
public:
    OrderBook(void);
    ~OrderBook(void);
    void Add(Side side_, myDecimal price_, int lots_) 
    {
        if (side_ == Buy) {
            // inserts or returns existent
            OrderBookContainer::iterator it = buyContainer.insert(price_).first;
            // how to add lots i.e. OrderBookItem.lots += lots_?
            // auto curLevel = buyContainer.get&lt;name&gt;(price);
            // curLevel.lots += Lots;
        } else if (side_ == Sell) {
            // inserts or returns existent
            OrderBookContainer::iterator it = sellContainer.insert(price_).first;
        }
    }
private:
    OrderBookContainer buyContainer;
    OrderBookContainer sellContainer;
};


I have the following questions:


For here:


OrderBookContainer::iterator it = buyContainer.insert(price_).first;



If I already have an item with price = price_ I receive it in \$O(1)\$ (from hashtable). If such a level doesn't exist, then is it added in \$O(log n)\$? If I'm wrong, then what should I write to get an item if it exists (in \$O(1)\$) otherwise add it (in \$O(log n)\$)?
Once I have an item, how can I modify lots to something like this?

OrderBookItem.lots += lots_
myDecimal is an absolutely unhelpful name overall.  I don't see any need to give int64_t a typedef here, but even if there is one, then it should still use a better name.
Empty void parameters are not needed in C++:


OrderBook(void);
~OrderBook(void);



You also don't need these defaults as the compiler will provide them for you.  They would only be necessary if you need to overload them and will still need default versions.
It's a little less-readable not having whitespace after commas:


BOOST_MULTI_INDEX_MEMBER(OrderBookItem,myDecimal,price)



Not only that, but you already add this whitespace in other places.  Keep it consistent.

BOOST_MULTI_INDEX_MEMBER(OrderBookItem, myDecimal, price)

You use different styles of curly braces.  C++ doesn't restrict you to a particular one, so choose one you prefer and stick with it.
Although this line has been commented out, are you still using C++11?


// auto curLevel = buyContainer.get&lt;name&gt;(price);



If so, then you can replace OrderBookContainer::iterator with auto:

auto it = buyContainer.insert(price_).first;




auto it = sellContainer.insert(price_).first;