An open API service indexing awesome lists of open source software.

https://github.com/htfy96/mylist

An array-based C++ MyList Class with robust exception safety
https://github.com/htfy96/mylist

Last synced: 4 months ago
JSON representation

An array-based C++ MyList Class with robust exception safety

Awesome Lists containing this project

README

          

# MyList
An array-based C++ MyList Class with robust exception safety
#Summary
**GCC with c++11 is incompatible with this project!**

##How to compile
| Command | Explaination |
|:---------------------:|:-------------------------:|
|`make`=`make gcc98` |compile it with gcc in c++98|
|`make clang98` |compile it with clang in c++98|
|`make clang11` |compile it with clang in c++11|
|`make clean` |clean `mylist` |
|`make prepare` |Generate tags/documents |
##Exception Classes

```cpp
* MyListBaseException (exceptionType, lineno, filename, msg, print())
* |
* +----MyListLogicError
* |
* +----MyListPopFromNullError
* +----MyListOutOfRangeError
* +----MyListResizeToZeroError
*
* Due to the lack of meta data in c++98, extra tag "exceptionType"
* is included in an object
```

##Exception Specifer
To keep compability with both C++98 and C++11, some macros are defined in this project:

| Example | Explaination |
|:-----------------:|:-------------------------:|
|`__MYLIST_NOEXCEPT`|No exception will raise in this function|
|`__MYLIST_NOEXCEPT_IF_2(throw MyListOutOfRangeError(),__MYLIST_COPY)` | This function may throw MyListOutOfRangeError and exception may raise in the copy constructor of T|

**Note**: There is a bug in gcc: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52869 which prevents __MYLIST_ASSIGN from working correctly, therefore I have to use __MYLIST_COPY to replace it.

##Documentation
Documentation generated by GNU Global could be found in `HTML` directory.

htfy96