symbols.hpp 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768
  1. // Copyright (c) 2001-2011 Hartmut Kaiser
  2. //
  3. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  4. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. #if !defined(BOOST_SPIRIT_KARMA_SYMBOLS_NOV_23_2009_1251PM)
  6. #define BOOST_SPIRIT_KARMA_SYMBOLS_NOV_23_2009_1251PM
  7. #include <boost/spirit/home/support/common_terminals.hpp>
  8. #include <boost/spirit/home/support/info.hpp>
  9. #include <boost/spirit/home/support/unused.hpp>
  10. #include <boost/spirit/home/support/attributes_fwd.hpp>
  11. #include <boost/spirit/home/support/detail/get_encoding.hpp>
  12. #include <boost/spirit/home/karma/detail/attributes.hpp>
  13. #include <boost/spirit/home/karma/detail/extract_from.hpp>
  14. #include <boost/spirit/home/karma/domain.hpp>
  15. #include <boost/spirit/home/karma/meta_compiler.hpp>
  16. #include <boost/spirit/home/karma/reference.hpp>
  17. #include <boost/spirit/home/karma/generate.hpp>
  18. #include <boost/spirit/home/karma/delimit_out.hpp>
  19. #include <boost/spirit/home/karma/detail/get_casetag.hpp>
  20. #include <boost/spirit/home/karma/detail/string_generate.hpp>
  21. #include <boost/config.hpp>
  22. #include <boost/proto/extends.hpp>
  23. #include <boost/proto/traits.hpp>
  24. #include <boost/shared_ptr.hpp>
  25. #include <boost/mpl/if.hpp>
  26. #include <map>
  27. #include <set>
  28. #if defined(BOOST_MSVC)
  29. # pragma warning(push)
  30. # pragma warning(disable: 4355) // 'this' : used in base member initializer list warning
  31. #endif
  32. ///////////////////////////////////////////////////////////////////////////////
  33. namespace boost { namespace spirit { namespace traits
  34. {
  35. template <typename T, typename Attribute, typename Enable>
  36. struct symbols_lookup
  37. {
  38. typedef
  39. mpl::eval_if<fusion::traits::is_sequence<T>
  40. , traits::detail::value_at_c<T, 0>
  41. , detail::add_const_ref<T> > sequence_type;
  42. typedef typename
  43. mpl::eval_if<traits::is_container<T>
  44. , traits::container_value<T>
  45. , sequence_type>::type type;
  46. // fusion sequence
  47. template <typename T_>
  48. static type call(T_ const& t, mpl::false_, mpl::true_)
  49. {
  50. return fusion::at_c<0>(t);
  51. }
  52. // container
  53. template <typename T_, typename IsSequence>
  54. static type call(T_ const& t, mpl::true_, IsSequence)
  55. {
  56. return t[0];
  57. }
  58. // not a container and not a fusion sequence
  59. template <typename T_>
  60. static type call(T_ const& t, mpl::false_, mpl::false_)
  61. {
  62. return t;
  63. }
  64. static type call(T const& t)
  65. {
  66. typedef typename traits::is_container<T>::type is_container;
  67. typedef typename fusion::traits::is_sequence<T>::type is_sequence;
  68. return call(t, is_container(), is_sequence());
  69. }
  70. };
  71. template <typename Attribute>
  72. struct symbols_lookup<Attribute, Attribute>
  73. {
  74. typedef Attribute const& type;
  75. static type call(Attribute const& t)
  76. {
  77. return t;
  78. }
  79. };
  80. template <typename Attribute, typename T, typename Enable>
  81. struct symbols_value
  82. {
  83. typedef
  84. mpl::eval_if<fusion::traits::is_sequence<T>
  85. , traits::detail::value_at_c<T, 1>
  86. , mpl::identity<unused_type> > sequence_type;
  87. typedef typename
  88. mpl::eval_if<traits::is_container<T>
  89. , traits::container_value<T>
  90. , sequence_type>::type type;
  91. // fusion sequence
  92. template <typename T_>
  93. static type call(T_ const& t, mpl::false_, mpl::true_)
  94. {
  95. return fusion::at_c<1>(t);
  96. }
  97. // container
  98. template <typename T_, typename IsSequence>
  99. static type call(T_ const& t, mpl::true_, IsSequence)
  100. {
  101. return t[1];
  102. }
  103. // not a container nor a fusion sequence
  104. template <typename T_>
  105. static type call(T_ const&, mpl::false_, mpl::false_)
  106. {
  107. return unused;
  108. }
  109. static type call(T const& t)
  110. {
  111. typedef typename traits::is_container<T>::type is_container;
  112. typedef typename fusion::traits::is_sequence<T>::type is_sequence;
  113. return call(t, is_container(), is_sequence());
  114. }
  115. };
  116. template <typename Attribute>
  117. struct symbols_value<Attribute, Attribute>
  118. {
  119. typedef unused_type type;
  120. static type call(Attribute const&)
  121. {
  122. return unused;
  123. }
  124. };
  125. }}}
  126. ///////////////////////////////////////////////////////////////////////////////
  127. namespace boost { namespace spirit { namespace karma
  128. {
  129. ///////////////////////////////////////////////////////////////////////////
  130. template <typename T, typename Attribute>
  131. struct symbols_lookup
  132. : mpl::if_<
  133. traits::not_is_unused<T>
  134. , std::map<Attribute, T>
  135. , std::set<Attribute>
  136. >
  137. {};
  138. ///////////////////////////////////////////////////////////////////////////
  139. namespace detail
  140. {
  141. ///////////////////////////////////////////////////////////////////////
  142. template <typename CharEncoding, typename Tag>
  143. struct generate_encoded
  144. {
  145. typedef typename
  146. proto::terminal<tag::char_code<Tag, CharEncoding> >::type
  147. encoding_type;
  148. template <typename OutputIterator, typename Expr, typename Attribute>
  149. static bool call(OutputIterator& sink, Expr const& expr
  150. , Attribute const& attr)
  151. {
  152. encoding_type const encoding = encoding_type();
  153. return karma::generate(sink, encoding[expr], attr);
  154. }
  155. };
  156. template <>
  157. struct generate_encoded<unused_type, unused_type>
  158. {
  159. template <typename OutputIterator, typename Expr, typename Attribute>
  160. static bool call(OutputIterator& sink, Expr const& expr
  161. , Attribute const& attr)
  162. {
  163. return karma::generate(sink, expr, attr);
  164. }
  165. };
  166. }
  167. template <
  168. typename Attribute = char, typename T = unused_type
  169. , typename Lookup = typename symbols_lookup<T, Attribute>::type
  170. , typename CharEncoding = unused_type, typename Tag = unused_type>
  171. struct symbols
  172. : proto::extends<
  173. typename proto::terminal<
  174. reference<symbols<Attribute, T, Lookup, CharEncoding, Tag> >
  175. >::type
  176. , symbols<Attribute, T, Lookup, CharEncoding, Tag> >
  177. , primitive_generator<
  178. symbols<Attribute, T, Lookup, CharEncoding, Tag> >
  179. {
  180. typedef T value_type; // the value associated with each entry
  181. typedef reference<symbols> reference_;
  182. typedef typename proto::terminal<reference_>::type terminal;
  183. typedef proto::extends<terminal, symbols> base_type;
  184. template <typename Context, typename Unused>
  185. struct attribute
  186. {
  187. typedef Attribute type;
  188. };
  189. symbols(std::string const& name = "symbols")
  190. : base_type(terminal::make(reference_(*this)))
  191. , add(*this)
  192. , remove(*this)
  193. , lookup(new Lookup())
  194. , name_(name)
  195. {}
  196. symbols(symbols const& syms)
  197. : base_type(terminal::make(reference_(*this)))
  198. , add(*this)
  199. , remove(*this)
  200. , lookup(syms.lookup)
  201. , name_(syms.name_)
  202. {}
  203. template <typename CharEncoding_, typename Tag_>
  204. symbols(symbols<Attribute, T, Lookup, CharEncoding_, Tag_> const& syms)
  205. : base_type(terminal::make(reference_(*this)))
  206. , add(*this)
  207. , remove(*this)
  208. , lookup(syms.lookup)
  209. , name_(syms.name_)
  210. {}
  211. template <typename Symbols, typename Data>
  212. symbols(Symbols const& syms, Data const& data
  213. , std::string const& name = "symbols")
  214. : base_type(terminal::make(reference_(*this)))
  215. , add(*this)
  216. , remove(*this)
  217. , lookup(new Lookup())
  218. , name_(name)
  219. {
  220. typename range_const_iterator<Symbols>::type si = boost::begin(syms);
  221. typename range_const_iterator<Data>::type di = boost::begin(data);
  222. while (si != boost::end(syms))
  223. add(*si++, *di++);
  224. }
  225. symbols&
  226. operator=(symbols const& rhs)
  227. {
  228. *lookup = *rhs.lookup;
  229. name_ = rhs.name_;
  230. return *this;
  231. }
  232. template <typename CharEncoding_, typename Tag_>
  233. symbols&
  234. operator=(symbols<Attribute, T, Lookup, CharEncoding_, Tag_> const& rhs)
  235. {
  236. *lookup = *rhs.lookup;
  237. name_ = rhs.name_;
  238. return *this;
  239. }
  240. void clear()
  241. {
  242. lookup->clear();
  243. }
  244. struct adder;
  245. struct remover;
  246. template <typename Attr, typename T_>
  247. adder const&
  248. operator=(std::pair<Attr, T_> const& p)
  249. {
  250. lookup->clear();
  251. return add(p.first, p.second);
  252. }
  253. template <typename Attr, typename T_>
  254. friend adder const&
  255. operator+= (symbols& sym, std::pair<Attr, T_> const& p)
  256. {
  257. return sym.add(p.first, p.second);
  258. }
  259. template <typename Attr>
  260. friend remover const&
  261. operator-= (symbols& sym, Attr const& attr)
  262. {
  263. return sym.remove(attr);
  264. }
  265. #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
  266. // non-const version needed to suppress proto's += kicking in
  267. template <typename Attr, typename T_>
  268. friend adder const&
  269. operator+= (symbols& sym, std::pair<Attr, T_>& p)
  270. {
  271. return sym.add(p.first, p.second);
  272. }
  273. // non-const version needed to suppress proto's -= kicking in
  274. template <typename Attr>
  275. friend remover const&
  276. operator-= (symbols& sym, Attr& attr)
  277. {
  278. return sym.remove(attr);
  279. }
  280. #else
  281. // for rvalue references
  282. template <typename Attr, typename T_>
  283. friend adder const&
  284. operator+= (symbols& sym, std::pair<Attr, T_>&& p)
  285. {
  286. return sym.add(p.first, p.second);
  287. }
  288. // for rvalue references
  289. template <typename Attr>
  290. friend remover const&
  291. operator-= (symbols& sym, Attr&& attr)
  292. {
  293. return sym.remove(attr);
  294. }
  295. #endif
  296. template <typename F>
  297. void for_each(F f) const
  298. {
  299. std::for_each(lookup->begin(), lookup->end(), f);
  300. }
  301. template <typename Attr>
  302. value_type* find(Attr const& attr)
  303. {
  304. typename Lookup::iterator it = lookup->find(attr);
  305. return (it != lookup->end()) ? &(*it).second : 0;
  306. }
  307. template <typename Attr>
  308. value_type& at(Attr const& attr)
  309. {
  310. return (*lookup)[attr];
  311. }
  312. ///////////////////////////////////////////////////////////////////////
  313. template <typename OutputIterator, typename Context, typename Delimiter
  314. , typename Attr>
  315. bool generate(OutputIterator& sink, Context&, Delimiter const& d
  316. , Attr const& attr) const
  317. {
  318. typename Lookup::iterator it = lookup->find(
  319. traits::symbols_lookup<Attr, Attribute>::call(attr));
  320. if (it == lookup->end())
  321. return false;
  322. return karma::detail::generate_encoded<CharEncoding, Tag>::call(
  323. sink, (*it).second
  324. , traits::symbols_value<Attribute, Attr>::call(attr)) &&
  325. karma::delimit_out(sink, d);
  326. }
  327. template <typename Context>
  328. info what(Context&) const
  329. {
  330. return info(name_);
  331. }
  332. void name(std::string const &str)
  333. {
  334. name_ = str;
  335. }
  336. std::string const &name() const
  337. {
  338. return name_;
  339. }
  340. ///////////////////////////////////////////////////////////////////////
  341. #ifdef _MSC_VER
  342. # pragma warning(push)
  343. # pragma warning(disable: 4512) // assignment operator could not be generated.
  344. #endif
  345. struct adder
  346. {
  347. template <typename, typename = unused_type>
  348. struct result { typedef adder const& type; };
  349. adder(symbols& sym)
  350. : sym(sym)
  351. {
  352. }
  353. template <typename Attr>
  354. adder const&
  355. operator()(Attr const& attr, T const& val = T()) const
  356. {
  357. sym.lookup->insert(typename Lookup::value_type(attr, val));
  358. return *this;
  359. }
  360. template <typename Attr>
  361. adder const&
  362. operator, (Attr const& attr) const
  363. {
  364. sym.lookup->insert(typename Lookup::value_type(attr, T()));
  365. return *this;
  366. }
  367. symbols& sym;
  368. };
  369. struct remover
  370. {
  371. template <typename>
  372. struct result { typedef remover const& type; };
  373. remover(symbols& sym)
  374. : sym(sym)
  375. {
  376. }
  377. template <typename Attr>
  378. remover const&
  379. operator()(Attr const& attr) const
  380. {
  381. sym.lookup->erase(attr);
  382. return *this;
  383. }
  384. template <typename Attr>
  385. remover const&
  386. operator, (Attr const& attr) const
  387. {
  388. sym.lookup->erase(attr);
  389. return *this;
  390. }
  391. symbols& sym;
  392. };
  393. #ifdef _MSC_VER
  394. # pragma warning(pop)
  395. #endif
  396. adder add;
  397. remover remove;
  398. shared_ptr<Lookup> lookup;
  399. std::string name_;
  400. };
  401. ///////////////////////////////////////////////////////////////////////////
  402. // specialization for unused stored type
  403. template <
  404. typename Attribute, typename Lookup
  405. , typename CharEncoding, typename Tag>
  406. struct symbols<Attribute, unused_type, Lookup, CharEncoding, Tag>
  407. : proto::extends<
  408. typename proto::terminal<
  409. spirit::karma::reference<
  410. symbols<Attribute, unused_type, Lookup, CharEncoding, Tag> >
  411. >::type
  412. , symbols<Attribute, unused_type, Lookup, CharEncoding, Tag>
  413. >
  414. , spirit::karma::generator<
  415. symbols<Attribute, unused_type, Lookup, CharEncoding, Tag> >
  416. {
  417. typedef unused_type value_type; // the value associated with each entry
  418. typedef spirit::karma::reference<symbols> reference_;
  419. typedef typename proto::terminal<reference_>::type terminal;
  420. typedef proto::extends<terminal, symbols> base_type;
  421. template <typename Context, typename Unused>
  422. struct attribute
  423. {
  424. typedef Attribute type;
  425. };
  426. symbols(std::string const& name = "symbols")
  427. : base_type(terminal::make(reference_(*this)))
  428. , add(*this)
  429. , remove(*this)
  430. , lookup(new Lookup())
  431. , name_(name)
  432. {}
  433. symbols(symbols const& syms)
  434. : base_type(terminal::make(reference_(*this)))
  435. , add(*this)
  436. , remove(*this)
  437. , lookup(syms.lookup)
  438. , name_(syms.name_)
  439. {}
  440. template <typename CharEncoding_, typename Tag_>
  441. symbols(symbols<Attribute, unused_type, Lookup, CharEncoding_, Tag_> const& syms)
  442. : base_type(terminal::make(reference_(*this)))
  443. , add(*this)
  444. , remove(*this)
  445. , lookup(syms.lookup)
  446. , name_(syms.name_)
  447. {}
  448. template <typename Symbols, typename Data>
  449. symbols(Symbols const& syms, Data const& data
  450. , std::string const& name = "symbols")
  451. : base_type(terminal::make(reference_(*this)))
  452. , add(*this)
  453. , remove(*this)
  454. , lookup(new Lookup())
  455. , name_(name)
  456. {
  457. typename range_const_iterator<Symbols>::type si = boost::begin(syms);
  458. typename range_const_iterator<Data>::type di = boost::begin(data);
  459. while (si != boost::end(syms))
  460. add(*si++, *di++);
  461. }
  462. symbols&
  463. operator=(symbols const& rhs)
  464. {
  465. *lookup = *rhs.lookup;
  466. name_ = rhs.name_;
  467. return *this;
  468. }
  469. template <typename CharEncoding_, typename Tag_>
  470. symbols&
  471. operator=(symbols<Attribute, unused_type, Lookup, CharEncoding_, Tag_> const& rhs)
  472. {
  473. *lookup = *rhs.lookup;
  474. name_ = rhs.name_;
  475. return *this;
  476. }
  477. void clear()
  478. {
  479. lookup->clear();
  480. }
  481. struct adder;
  482. struct remover;
  483. template <typename Attr>
  484. adder const&
  485. operator=(Attr const& attr)
  486. {
  487. lookup->clear();
  488. return add(attr);
  489. }
  490. template <typename Attr>
  491. friend adder const&
  492. operator+= (symbols& sym, Attr const& attr)
  493. {
  494. return sym.add(attr);
  495. }
  496. template <typename Attr>
  497. friend remover const&
  498. operator-= (symbols& sym, Attr const& attr)
  499. {
  500. return sym.remove(attr);
  501. }
  502. // non-const version needed to suppress proto's += kicking in
  503. template <typename Attr>
  504. friend adder const&
  505. operator+= (symbols& sym, Attr& attr)
  506. {
  507. return sym.add(attr);
  508. }
  509. // non-const version needed to suppress proto's -= kicking in
  510. template <typename Attr>
  511. friend remover const&
  512. operator-= (symbols& sym, Attr& attr)
  513. {
  514. return sym.remove(attr);
  515. }
  516. template <typename F>
  517. void for_each(F f) const
  518. {
  519. std::for_each(lookup->begin(), lookup->end(), f);
  520. }
  521. template <typename Attr>
  522. value_type const* find(Attr const& attr)
  523. {
  524. typename Lookup::iterator it = lookup->find(attr);
  525. return (it != lookup->end()) ? &unused : 0;
  526. }
  527. template <typename Attr>
  528. value_type at(Attr const& attr)
  529. {
  530. typename Lookup::iterator it = lookup->find(attr);
  531. if (it == lookup->end())
  532. add(attr);
  533. return unused;
  534. }
  535. ///////////////////////////////////////////////////////////////////////
  536. template <typename OutputIterator, typename Context, typename Delimiter
  537. , typename Attr>
  538. bool generate(OutputIterator& sink, Context&, Delimiter const& d
  539. , Attr const& attr) const
  540. {
  541. typename Lookup::iterator it = lookup->find(
  542. traits::symbols_lookup<Attr, Attribute>::call(attr));
  543. if (it == lookup->end())
  544. return false;
  545. return karma::detail::generate_encoded<CharEncoding, Tag>::
  546. call(sink
  547. , traits::symbols_lookup<Attr, Attribute>::call(attr)
  548. , unused) &&
  549. karma::delimit_out(sink, d);
  550. }
  551. template <typename Context>
  552. info what(Context&) const
  553. {
  554. return info(name_);
  555. }
  556. void name(std::string const &str)
  557. {
  558. name_ = str;
  559. }
  560. std::string const &name() const
  561. {
  562. return name_;
  563. }
  564. ///////////////////////////////////////////////////////////////////////
  565. #ifdef _MSC_VER
  566. # pragma warning(push)
  567. # pragma warning(disable: 4512) // assignment operator could not be generated.
  568. #endif
  569. struct adder
  570. {
  571. template <typename, typename = unused_type>
  572. struct result { typedef adder const& type; };
  573. adder(symbols& sym)
  574. : sym(sym)
  575. {
  576. }
  577. template <typename Attr>
  578. adder const&
  579. operator()(Attr const& attr) const
  580. {
  581. sym.lookup->insert(attr);
  582. return *this;
  583. }
  584. template <typename Attr>
  585. adder const&
  586. operator, (Attr const& attr) const
  587. {
  588. sym.lookup->insert(attr);
  589. return *this;
  590. }
  591. symbols& sym;
  592. };
  593. struct remover
  594. {
  595. template <typename>
  596. struct result { typedef remover const& type; };
  597. remover(symbols& sym)
  598. : sym(sym)
  599. {
  600. }
  601. template <typename Attr>
  602. remover const&
  603. operator()(Attr const& attr) const
  604. {
  605. sym.lookup->erase(attr);
  606. return *this;
  607. }
  608. template <typename Attr>
  609. remover const&
  610. operator, (Attr const& attr) const
  611. {
  612. sym.lookup->erase(attr);
  613. return *this;
  614. }
  615. symbols& sym;
  616. };
  617. #ifdef _MSC_VER
  618. # pragma warning(pop)
  619. #endif
  620. adder add;
  621. remover remove;
  622. shared_ptr<Lookup> lookup;
  623. std::string name_;
  624. };
  625. ///////////////////////////////////////////////////////////////////////////
  626. // Generator generators: make_xxx function (objects)
  627. ///////////////////////////////////////////////////////////////////////////
  628. template <typename Attribute, typename T, typename Lookup
  629. , typename CharEnconding, typename Tag, typename Modifiers>
  630. struct make_primitive<
  631. reference<symbols<Attribute, T, Lookup, CharEnconding, Tag> >
  632. , Modifiers>
  633. {
  634. static bool const lower =
  635. has_modifier<Modifiers, tag::char_code_base<tag::lower> >::value;
  636. static bool const upper =
  637. has_modifier<Modifiers, tag::char_code_base<tag::upper> >::value;
  638. typedef reference<
  639. symbols<Attribute, T, Lookup, CharEnconding, Tag>
  640. > reference_;
  641. typedef typename mpl::if_c<
  642. lower || upper
  643. , symbols<
  644. Attribute, T, Lookup
  645. , typename spirit::detail::get_encoding_with_case<
  646. Modifiers, unused_type, lower || upper>::type
  647. , typename detail::get_casetag<Modifiers, lower || upper>::type>
  648. , reference_>::type
  649. result_type;
  650. result_type operator()(reference_ ref, unused_type) const
  651. {
  652. return result_type(ref.ref.get());
  653. }
  654. };
  655. }}}
  656. namespace boost { namespace spirit { namespace traits
  657. {
  658. ///////////////////////////////////////////////////////////////////////////
  659. template <typename Attribute, typename T, typename Lookup
  660. , typename CharEncoding, typename Tag
  661. , typename Attr, typename Context, typename Iterator>
  662. struct handles_container<karma::symbols<Attribute, T, Lookup, CharEncoding, Tag>
  663. , Attr, Context, Iterator>
  664. : traits::is_container<Attr> {};
  665. }}}
  666. #if defined(BOOST_MSVC)
  667. # pragma warning(pop)
  668. #endif
  669. #endif