Commit Graph

7 Commits

Author SHA1 Message Date
Maxime Coste
26537d7028 Utils: Singleton template and migration of the BufferManager
Singletons are not autocreating, the application needs to create
exactly one instance (I want to avoid implicit initialization order
hell)
2011-09-23 14:26:53 +00:00
Maxime Coste
34c9b0d30f LineAndColumn: move to it's own header and add operator[+-]=?
LineAndColumn is now a template so that WindowCoords and BufferCoords
cannot be added together.
2011-09-17 14:13:33 +00:00
Maxime Coste
4b38cd3cd0 utils: add auto_raii helper function
this helper permits to register a resource and cleanup function to keep
exception safety with C like resource. For exemple, to be sure that a
FILE* will be closed, you can use:

auto file = auto_raii(fopen("filename"), fclose);

file will auto cast to FILE* when needed, and will call fclose when
going out of scope.
2011-09-14 15:36:35 +00:00
Maxime Coste
030c5caf0a assert: custom implementation 2011-09-09 19:24:18 +00:00
Maxime Coste
511df5b660 utils: add operator== (const std::unique_ptr<T>&, T*) 2011-09-08 00:08:55 +00:00
Maxime Coste
f58cbf0b98 utils: Add reversed template helper for container iteration
this permits to use range-based for loops to iterate on reversed
containers. Should work on any container implementing rbegin and rend.
2011-09-06 18:33:35 +00:00
Maxime Coste
6668151c78 LineAndColumn: segregate into WindowCoord and BufferCoord
Having the same type to specify coordinates in window space or buffer
space is error prone, now the compiler will tell if we use one for
another.
2011-09-05 19:06:31 +00:00