As others have noted, a predicate to determine sorted state is O(n). But from your mention of a sorted flag, I kind of wonder if you don't want something like this:
Our application's foundation libraries includes a container class which can be queried for membership. Here is a brief sketch:
class ObjList {
public:
ObjList() {};
~ObjList() {};
bool isMember(const Item *);
void add(const Item *, bool sort = false);
private:
unsigned int last_sorted_d;
bool sorted_d;
unsigned int count_d;
Item *store_d;
};
isMember() uses a binary search on the sorted range of elements, then a linear search of items after the sorted range. Insertion can trigger a sort of the items, or not, according to the programmer's choice. For instance, if you are aware that you'll be adding thousands of items in a tight loop, don't sort until the final insertion.
The above is just a sketch, and the store is more complicated than an array of pointers, but you get the idea.