# No member named 'apply' in namespace 'std

**URL:** <https://root-forum.cern.ch/t/no-member-named-apply-in-namespace-std/57522>\
**Category:** Newbie\
**Created:** [December 13, 2023, 12:07pm UTC](https://root-forum.cern.ch/t/no-member-named-apply-in-namespace-std/57522 "2023-12-13T12:07:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cw2636](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/a9adbd/32.png) [@cw2636](https://root-forum.cern.ch/u/cw2636)\
**Post date:** [December 13, 2023, 12:07pm UTC](https://root-forum.cern.ch/t/no-member-named-apply-in-namespace-std/57522/1 "2023-12-13T12:07:48Z")

</div>

I install cling using the instructions here [Cling Build Instructions - ROOT](https://root.cern/cling/cling_build_instructions/). The installation was successful and can use cling anywhere in my bash shell. I created a test script which looks like  
script.cxx

```auto
//#! /usr/local/bin/cling --metastr=//.

#include <iostream>

using namespace std;

void script(){
    std::cout << "This is a test" << std::endl;
}

```

Executing this script in cling works without error. But executing the below script shows the error.

#### script.cxx:

```auto
//#! /usr/local/bin/cling --metastr=//.

#include <iostream>

using namespace std;

int script(){
    std::cout << "This is a test" << std::endl;
    return 0;
}

```

```auto
******************CLING******************
* Type C++ code and press enter to run it *
* Type .q to exit *
*******************************************
[cling]$ .x script.cxx
This is a test
In file included from input_line_5:1:
xxxxx/include/cling/Interpreter/RuntimePrintValue.h:249:33: warning: template template parameter using 'typename' is a C++17 extension [-Wc++17-extensions]
  template <template <class...> typename TUPLE, typename... ARGS,
                                ^ ~~~~~~~
                                class
xxxxx/include/cling/Interpreter/RuntimePrintValue.h:260:8: warning: pack fold expression is a C++17 extension [-Wc++17-extensions]
       ...);
       ^
xxxxx/include/cling/Interpreter/RuntimePrintValue.h:263:10: error: no member named 'apply' in namespace 'std'
    std::apply(concatToStr, *val);
    ~~~~~ ^
(int) 0

```

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [December 13, 2023, 12:28pm UTC](https://root-forum.cern.ch/t/no-member-named-apply-in-namespace-std/57522/2 "2023-12-13T12:28:55Z")

</div>

I did not try with cling but with root it is ok:

```auto
% root
   ------------------------------------------------------------------
  | Welcome to ROOT 6.31/01 https://root.cern |
  | (c) 1995-2023, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for macosx64 on Dec 13 2023, 10:26:08 |
  | From heads/master@v6-31-01-399-g51c26e882d |
  | With Apple clang version 14.0.0 (clang-1400.0.29.202) |
  | Try '.help'/'.?', '.demo', '.license', '.credits', '.quit'/'.q' |
   ------------------------------------------------------------------

root [0] .x script.cxx
This is a test
(int) 0
root [1] 

```

---

<div class="post-metadata">

**Author:** ![vpadulan](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/vpadulan/32/25315_2.png) [@vpadulan](https://root-forum.cern.ch/u/vpadulan)\
**Post date:** [December 13, 2023, 2:23pm UTC](https://root-forum.cern.ch/t/no-member-named-apply-in-namespace-std/57522/3 "2023-12-13T14:23:44Z")

</div>

Dear @cw2636 ,

I think the cling release you downloaded is affected by this PR [Revert "[Cling] Simplify std::tuple/pair value printer" by Axel-Naumann · Pull Request #14197 · root-project/root · GitHub](https://github.com/root-project/root/pull/14197) . It should be fixed in the latest development branch of ROOT/cling. Can you try by downloading and building the latest cling? Since we also just updated to use LLVM16 as a baseline, this should be the most appropriate build instructions

```auto
git clone -b cling-llvm16 https://github.com/root-project/llvm-project.git src
git clone https://github.com/root-project/cling.git

```

The rest is the same as the link you provided. I will also take care of updating those instructions on the website.

**Note** : make sure you create a completely new build, removing any previous existing installation.

Cheers,  
Vincenzo

---

<div class="post-metadata">

**Author:** ![cw2636](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/a9adbd/32.png) [@cw2636](https://root-forum.cern.ch/u/cw2636)\
**Post date:** [December 13, 2023, 2:36pm UTC](https://root-forum.cern.ch/t/no-member-named-apply-in-namespace-std/57522/4 "2023-12-13T14:36:40Z")

</div>

Thank you
