Skip to content

Commit c9cf761

Browse files
committed
Added C++17 [[nodiscard]] support g-truc#1252
Avoid merge conflicts
1 parent f871bd1 commit c9cf761

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

glm/gtx/io.hpp

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,17 @@ namespace glm
7070
char_type firstline;
7171
order_type order;
7272

73-
GLM_FUNC_DECL explicit format_punct(size_t a = 0);
74-
GLM_FUNC_DECL explicit format_punct(format_punct const&);
73+
GLM_FUNC_DISCARD_DECL explicit format_punct(size_t a = 0);
74+
GLM_FUNC_DISCARD_DECL explicit format_punct(format_punct const&);
7575
};
7676

7777
template<typename CTy, typename CTr = std::char_traits<CTy> >
7878
class basic_state_saver {
7979

8080
public:
8181

82-
GLM_FUNC_DECL explicit basic_state_saver(std::basic_ios<CTy,CTr>&);
83-
GLM_FUNC_DECL ~basic_state_saver();
82+
GLM_FUNC_DISCARD_DECL explicit basic_state_saver(std::basic_ios<CTy,CTr>&);
83+
GLM_FUNC_DISCARD_DECL ~basic_state_saver();
8484

8585
private:
8686

@@ -108,8 +108,8 @@ namespace glm
108108
{
109109
public:
110110

111-
GLM_FUNC_DECL explicit basic_format_saver(std::basic_ios<CTy,CTr>&);
112-
GLM_FUNC_DECL ~basic_format_saver();
111+
GLM_FUNC_DISCARD_DECL explicit basic_format_saver(std::basic_ios<CTy,CTr>&);
112+
GLM_FUNC_DISCARD_DECL ~basic_format_saver();
113113

114114
private:
115115

@@ -125,36 +125,36 @@ namespace glm
125125
{
126126
unsigned value;
127127

128-
GLM_FUNC_DECL explicit precision(unsigned = 3);
128+
GLM_FUNC_DISCARD_DECL explicit precision(unsigned = 3);
129129
};
130130

131131
struct width
132132
{
133133
unsigned value;
134134

135-
GLM_FUNC_DECL explicit width(unsigned = 8);
135+
GLM_FUNC_DISCARD_DECL explicit width(unsigned = 8);
136136
};
137137

138138
template<typename CTy>
139139
struct delimeter
140140
{
141141
CTy value[3];
142142

143-
GLM_FUNC_DECL explicit delimeter(CTy /* left */ = "[", CTy /* right */ = "]", CTy /* separator */ = ',');
143+
GLM_FUNC_DISCARD_DECL explicit delimeter(CTy /* left */ = "[", CTy /* right */ = "]", CTy /* separator */ = ',');
144144
};
145145

146146
template<typename CTy>
147147
struct filler
148148
{
149149
CTy value[4];
150-
GLM_FUNC_DECL explicit filler(CTy /* fill */ = ' ', CTy /* space */ = ' ', CTy /* newline */ = '\n', CTy /* firstline */ = '\n');
150+
GLM_FUNC_DISCARD_DECL explicit filler(CTy /* fill */ = ' ', CTy /* space */ = ' ', CTy /* newline */ = '\n', CTy /* firstline */ = '\n');
151151
};
152152

153153
struct order
154154
{
155155
order_type value;
156156

157-
GLM_FUNC_DECL explicit order(order_type = column_major);
157+
GLM_FUNC_DISCARD_DECL explicit order(order_type = column_major);
158158
};
159159

160160
// functions, inlined (inline)
@@ -184,36 +184,36 @@ namespace glm
184184
}//namespace io
185185

186186
template<typename CTy, typename CTr, typename T, qualifier Q>
187-
GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, qua<T, Q> const&);
187+
GLM_FUNC_DISCARD_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, qua<T, Q> const&);
188188
template<typename CTy, typename CTr, typename T, qualifier Q>
189-
GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, vec<1, T, Q> const&);
189+
GLM_FUNC_DISCARD_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, vec<1, T, Q> const&);
190190
template<typename CTy, typename CTr, typename T, qualifier Q>
191-
GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, vec<2, T, Q> const&);
191+
GLM_FUNC_DISCARD_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, vec<2, T, Q> const&);
192192
template<typename CTy, typename CTr, typename T, qualifier Q>
193-
GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, vec<3, T, Q> const&);
193+
GLM_FUNC_DISCARD_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, vec<3, T, Q> const&);
194194
template<typename CTy, typename CTr, typename T, qualifier Q>
195-
GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, vec<4, T, Q> const&);
195+
GLM_FUNC_DISCARD_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, vec<4, T, Q> const&);
196196
template<typename CTy, typename CTr, typename T, qualifier Q>
197-
GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, mat<2, 2, T, Q> const&);
197+
GLM_FUNC_DISCARD_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, mat<2, 2, T, Q> const&);
198198
template<typename CTy, typename CTr, typename T, qualifier Q>
199-
GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, mat<2, 3, T, Q> const&);
199+
GLM_FUNC_DISCARD_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, mat<2, 3, T, Q> const&);
200200
template<typename CTy, typename CTr, typename T, qualifier Q>
201-
GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, mat<2, 4, T, Q> const&);
201+
GLM_FUNC_DISCARD_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, mat<2, 4, T, Q> const&);
202202
template<typename CTy, typename CTr, typename T, qualifier Q>
203-
GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, mat<3, 2, T, Q> const&);
203+
GLM_FUNC_DISCARD_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, mat<3, 2, T, Q> const&);
204204
template<typename CTy, typename CTr, typename T, qualifier Q>
205-
GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, mat<3, 3, T, Q> const&);
205+
GLM_FUNC_DISCARD_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, mat<3, 3, T, Q> const&);
206206
template<typename CTy, typename CTr, typename T, qualifier Q>
207-
GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, mat<3, 4, T, Q> const&);
207+
GLM_FUNC_DISCARD_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, mat<3, 4, T, Q> const&);
208208
template<typename CTy, typename CTr, typename T, qualifier Q>
209-
GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, mat<4, 2, T, Q> const&);
209+
GLM_FUNC_DISCARD_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, mat<4, 2, T, Q> const&);
210210
template<typename CTy, typename CTr, typename T, qualifier Q>
211-
GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, mat<4, 3, T, Q> const&);
211+
GLM_FUNC_DISCARD_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, mat<4, 3, T, Q> const&);
212212
template<typename CTy, typename CTr, typename T, qualifier Q>
213-
GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, mat<4, 4, T, Q> const&);
213+
GLM_FUNC_DISCARD_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, mat<4, 4, T, Q> const&);
214214

215-
template<typename CTy, typename CTr, typename T, qualifier Q>
216-
GLM_FUNC_DECL std::basic_ostream<CTy,CTr> & operator<<(std::basic_ostream<CTy,CTr> &,
215+
template<typename CTy, typename CTr, typename T, qualifier Q>
216+
GLM_FUNC_DISCARD_DECL std::basic_ostream<CTy,CTr> & operator<<(std::basic_ostream<CTy,CTr> &,
217217
std::pair<mat<4, 4, T, Q> const, mat<4, 4, T, Q> const> const&);
218218

219219
/// @}

0 commit comments

Comments
 (0)