projects
/
argpar.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
argpar.h: make all the functions `noexcept` with C++ ≥ 11
[argpar.git]
/
argpar
/
argpar.h
diff --git
a/argpar/argpar.h
b/argpar/argpar.h
index 498bb2aeb892f88fc25918f42744dbfcaa090c9a..4698c2dd660052388241fb0addcf11008f19fad0 100644
(file)
--- a/
argpar/argpar.h
+++ b/
argpar/argpar.h
@@
-124,6
+124,13
@@
argpar_iter_next() produces the following items, in this order:
# define ARGPAR_HIDDEN __attribute__((visibility("hidden")))
#endif
# define ARGPAR_HIDDEN __attribute__((visibility("hidden")))
#endif
+/* Internal: `noexcept` specifier if C++ ≥ 11 */
+#if defined(__cplusplus) && (__cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1900))
+# define ARGPAR_NOEXCEPT noexcept
+#else
+# define ARGPAR_NOEXCEPT
+#endif
+
struct argpar_opt_descr;
/*!
struct argpar_opt_descr;
/*!
@@
-170,7
+177,8
@@
struct argpar_item;
/// @cond hidden_macro
ARGPAR_HIDDEN
/// @endcond
/// @cond hidden_macro
ARGPAR_HIDDEN
/// @endcond
-enum argpar_item_type argpar_item_type(const struct argpar_item *item);
+enum argpar_item_type argpar_item_type(
+ const struct argpar_item *item) ARGPAR_NOEXCEPT;
/*!
@brief
/*!
@brief
@@
-191,7
+199,7
@@
enum argpar_item_type argpar_item_type(const struct argpar_item *item);
ARGPAR_HIDDEN
/// @endcond
const struct argpar_opt_descr *argpar_item_opt_descr(
ARGPAR_HIDDEN
/// @endcond
const struct argpar_opt_descr *argpar_item_opt_descr(
- const struct argpar_item *item);
+ const struct argpar_item *item)
ARGPAR_NOEXCEPT
;
/*!
@brief
/*!
@brief
@@
-212,7
+220,7
@@
const struct argpar_opt_descr *argpar_item_opt_descr(
/// @cond hidden_macro
ARGPAR_HIDDEN
/// @endcond
/// @cond hidden_macro
ARGPAR_HIDDEN
/// @endcond
-const char *argpar_item_opt_arg(const struct argpar_item *item);
+const char *argpar_item_opt_arg(const struct argpar_item *item)
ARGPAR_NOEXCEPT
;
/*!
@brief
/*!
@brief
@@
-235,7
+243,8
@@
const char *argpar_item_opt_arg(const struct argpar_item *item);
/// @cond hidden_macro
ARGPAR_HIDDEN
/// @endcond
/// @cond hidden_macro
ARGPAR_HIDDEN
/// @endcond
-const char *argpar_item_non_opt_arg(const struct argpar_item *item);
+const char *argpar_item_non_opt_arg(
+ const struct argpar_item *item) ARGPAR_NOEXCEPT;
/*!
@brief
/*!
@brief
@@
-271,7
+280,8
@@
argument index of \c mix is 4.
/// @cond hidden_macro
ARGPAR_HIDDEN
/// @endcond
/// @cond hidden_macro
ARGPAR_HIDDEN
/// @endcond
-unsigned int argpar_item_non_opt_orig_index(const struct argpar_item *item);
+unsigned int argpar_item_non_opt_orig_index(
+ const struct argpar_item *item) ARGPAR_NOEXCEPT;
/*!
@brief
/*!
@brief
@@
-306,7
+316,8
@@
argument index of \c mix is 1.
/// @cond hidden_macro
ARGPAR_HIDDEN
/// @endcond
/// @cond hidden_macro
ARGPAR_HIDDEN
/// @endcond
-unsigned int argpar_item_non_opt_non_opt_index(const struct argpar_item *item);
+unsigned int argpar_item_non_opt_non_opt_index(
+ const struct argpar_item *item) ARGPAR_NOEXCEPT;
/*!
@brief
/*!
@brief
@@
-318,7
+329,7
@@
unsigned int argpar_item_non_opt_non_opt_index(const struct argpar_item *item);
/// @cond hidden_macro
ARGPAR_HIDDEN
/// @endcond
/// @cond hidden_macro
ARGPAR_HIDDEN
/// @endcond
-void argpar_item_destroy(const struct argpar_item *item);
+void argpar_item_destroy(const struct argpar_item *item)
ARGPAR_NOEXCEPT
;
/*!
@def ARGPAR_ITEM_DESTROY_AND_RESET(_item)
/*!
@def ARGPAR_ITEM_DESTROY_AND_RESET(_item)
@@
-384,7
+395,8
@@
struct argpar_error;
/// @cond hidden_macro
ARGPAR_HIDDEN
/// @endcond
/// @cond hidden_macro
ARGPAR_HIDDEN
/// @endcond
-enum argpar_error_type argpar_error_type(const struct argpar_error *error);
+enum argpar_error_type argpar_error_type(
+ const struct argpar_error *error) ARGPAR_NOEXCEPT;
/*!
@brief
/*!
@brief
@@
-404,7
+416,8
@@
enum argpar_error_type argpar_error_type(const struct argpar_error *error);
/// @cond hidden_macro
ARGPAR_HIDDEN
/// @endcond
/// @cond hidden_macro
ARGPAR_HIDDEN
/// @endcond
-unsigned int argpar_error_orig_index(const struct argpar_error *error);
+unsigned int argpar_error_orig_index(
+ const struct argpar_error *error) ARGPAR_NOEXCEPT;
/*!
@brief
/*!
@brief
@@
-434,7
+447,8
@@
part (<code>\--mireille</code> in the last example).
/// @cond hidden_macro
ARGPAR_HIDDEN
/// @endcond
/// @cond hidden_macro
ARGPAR_HIDDEN
/// @endcond
-const char *argpar_error_unknown_opt_name(const struct argpar_error *error);
+const char *argpar_error_unknown_opt_name(
+ const struct argpar_error *error) ARGPAR_NOEXCEPT;
/*!
@brief
/*!
@brief
@@
-469,7
+483,8
@@
const char *argpar_error_unknown_opt_name(const struct argpar_error *error);
ARGPAR_HIDDEN
/// @endcond
const struct argpar_opt_descr *argpar_error_opt_descr(
ARGPAR_HIDDEN
/// @endcond
const struct argpar_opt_descr *argpar_error_opt_descr(
- const struct argpar_error *error, bool *is_short);
+ const struct argpar_error *error,
+ bool *is_short) ARGPAR_NOEXCEPT;
/*!
@brief
/*!
@brief
@@
-481,7
+496,7
@@
const struct argpar_opt_descr *argpar_error_opt_descr(
/// @cond hidden_macro
ARGPAR_HIDDEN
/// @endcond
/// @cond hidden_macro
ARGPAR_HIDDEN
/// @endcond
-void argpar_error_destroy(const struct argpar_error *error);
+void argpar_error_destroy(const struct argpar_error *error)
ARGPAR_NOEXCEPT
;
/// @}
/// @}
@@
-608,7
+623,7
@@
ARGPAR_HIDDEN
/// @endcond
struct argpar_iter *argpar_iter_create(unsigned int argc,
const char * const *argv,
/// @endcond
struct argpar_iter *argpar_iter_create(unsigned int argc,
const char * const *argv,
- const struct argpar_opt_descr *descrs);
+ const struct argpar_opt_descr *descrs)
ARGPAR_NOEXCEPT
;
/*!
@brief
/*!
@brief
@@
-623,7
+638,7
@@
struct argpar_iter *argpar_iter_create(unsigned int argc,
/// @cond hidden_macro
ARGPAR_HIDDEN
/// @endcond
/// @cond hidden_macro
ARGPAR_HIDDEN
/// @endcond
-void argpar_iter_destroy(struct argpar_iter *iter);
+void argpar_iter_destroy(struct argpar_iter *iter)
ARGPAR_NOEXCEPT
;
/*!
@brief
/*!
@brief
@@
-683,7
+698,7
@@
ARGPAR_HIDDEN
/// @endcond
enum argpar_iter_next_status argpar_iter_next(
struct argpar_iter *iter, const struct argpar_item **item,
/// @endcond
enum argpar_iter_next_status argpar_iter_next(
struct argpar_iter *iter, const struct argpar_item **item,
- const struct argpar_error **error);
+ const struct argpar_error **error)
ARGPAR_NOEXCEPT
;
/*
* Returns the number of ingested elements from `argv`, as passed to
/*
* Returns the number of ingested elements from `argv`, as passed to
@@
-710,7
+725,8
@@
enum argpar_iter_next_status argpar_iter_next(
/// @cond hidden_macro
ARGPAR_HIDDEN
/// @endcond
/// @cond hidden_macro
ARGPAR_HIDDEN
/// @endcond
-unsigned int argpar_iter_ingested_orig_args(const struct argpar_iter *iter);
+unsigned int argpar_iter_ingested_orig_args(
+ const struct argpar_iter *iter) ARGPAR_NOEXCEPT;
/// @}
/// @}
This page took
0.025325 seconds
and
4
git commands to generate.