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
- Host: GitHub
- URL: https://github.com/htfy96/mylist
- Owner: htfy96
- License: gpl-3.0
- Created: 2015-06-07T03:26:03.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-06-09T10:27:32.000Z (about 11 years ago)
- Last Synced: 2025-01-13T18:52:25.325Z (over 1 year ago)
- Language: HTML
- Size: 418 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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