File: kwd_arg_macros.hpp

package info (click to toggle)
golang-github-wellington-go-libsass 0.9.2%2Bgit20181130.4ef5b9d-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,128 kB
  • sloc: cpp: 28,607; ansic: 839; makefile: 44
file content (28 lines) | stat: -rw-r--r-- 514 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef SASS_KWD_ARG_MACROS_H
#define SASS_KWD_ARG_MACROS_H

// Example usage:
// KWD_ARG_SET(Args) {
//   KWD_ARG(Args, string, foo);
//   KWD_ARG(Args, int, bar);
//   ...
// };
//
// ... and later ...
//
// something(Args().foo("hey").bar(3));

#define KWD_ARG_SET(set_name) class set_name

#define KWD_ARG(set_name, type, name) \
private: \
  type name##_; \
public: \
  set_name& name(type name##__) { \
    name##_ = name##__; \
    return *this; \
  } \
  type name() { return name##_; } \
private:

#endif